summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mychemistry
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-04-05 23:17:45 +0000
committerKarl Berry <karl@freefriends.org>2011-04-05 23:17:45 +0000
commit45355d823acdbb26b128d0aa6370058a85b7ecb5 (patch)
tree1fa57142655e811ea519516ff03cd44e0c08433f /Master/texmf-dist/tex/latex/mychemistry
parent024228db99693079b2ebbc9aff20e89811eb8810 (diff)
mychemistry 1.3 (5apr11)
git-svn-id: svn://tug.org/texlive/trunk@21984 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mychemistry')
-rw-r--r--Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty1024
1 files changed, 566 insertions, 458 deletions
diff --git a/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty b/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty
index 13aaeb8d82e..07b86991346 100644
--- a/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty
+++ b/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty
@@ -4,7 +4,7 @@
% - Creating reaction schemes with LaTeX and ChemFig ---------------------------------- %
% ------------------------------------------------------------------------------------- %
% - Clemens Niederberger -------------------------------------------------------------- %
-% - 2011/03/20 ------------------------------------------------------------------------ %
+% - 2011/03/27 ------------------------------------------------------------------------ %
% ------------------------------------------------------------------------------------- %
% - http://www.niederberger-berlin.net/2011/02/latex-mychemistry/ --------------------- %
% - kontakt@niederberger-berlin.net --------------------------------------------------- %
@@ -57,91 +57,119 @@
% - arrow key `both' added - %
% - rxn has now keys instead of an option - %
% - commands \setrcndist, \setrxnalign, \setschemealign added - %
-% - rxn-, rxnscheme-key align added - %
+% - rxn-, rxnscheme-key align added - %
+% - 2011/03/26 version 1.2.1 - %
+% - rewriting commands, so they accept second argument without first: - %
+% - \reactand, \mesomeric, \transition, \branch, \makevisible, \makeinvisible - %
+% - rewritten - %
+% - 2011/03/28 version 1.2.2 - %
+% - bugfix with transition resolved - %
+% - atomsize, arrowlength, bondlength and bondshape renamed into set<name> - %
+% - and code slightly rewritten - %
+% - \mCsetup added - %
+% - 2011/04/01 version 1.2.3 - %
+% - bug in \branch resolved - %
+% - \chemand added - %
+% - 2011/04/02 version 1.2.4 - %
+% - bugs in \makevisible, \makeinvisible resolved - %
+% - input bondwidth.tex if ChemFig v0.4 - %
+% - 2011/04/04 version 1.3 - %
+% - commands \reactand, \mesomeric, \branch, \transition, \chemand (\makeinvisible - %
+% - \makeinvisible) rewritten: more flexible with opt. arguments - %
% ------------------------------------------------------------------------------------- %
% - TODO - %
% - make the arrow type {-|>} look nicer - %
% - work on how chemistry-packages are automatically loaded; - %
% - add ui for easy handling this issue? (via \mCsetup ?) - %
% - add rotate=<winkel> for diagonal arrows? - %
-% - add \mCdefault or sim. to restore all default settings? - %
+% - option for baseline-alignment of reactands et.al.? - %
+% - option for shifting arrows? - %
% ------------------------------------------------------------------------------------- %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\@mc@version{v1.2}
-\def\@mc@date@de{20. M\"arz 2011}
-\def\@mc@date@en{March 20th 2011}
-\ProvidesPackage{mychemistry}[2011/03/20]
-\typeout{myChemistry \@mc@version}
-\typeout{2011/03/20 Clemens Niederberger}
+\def\mC@def#1{%
+ \ifdefined#1%
+ \errmessage{myChemistry Package Error: the macro \string#1\space is already defined. Please let the author know.}%
+ \fi
+ \def#1%
+}
+\mC@def\mC@version{v1.3}
+\mC@def\mC@date@de{04. April 2011}
+\mC@def\mC@date@en{April 4th 2011}
+\mC@def\mC@Date{2011/04/04}
+\mC@def\mC@name{myChemistry}
+\ProvidesPackage{mychemistry}[\mC@Date\space v\mC@version]
+\typeout{}
+\typeout{\mC@name\space \mC@version}
+\typeout{\mC@Date\space Clemens Niederberger}
\typeout{}
\RequirePackage{ifthen,calc,float}
\RequirePackage{xkeyval}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Optionen, z.T. auch an chemexec weitergeben
-\newcommand{\@mc@exec@color}{black}
-\newcommand{\@mc@exec@shade}{false}
+\newcommand{\mC@exec@color}{black}
+\newcommand{\mC@exec@shade}{false}
\newif\if@usecolor\@usecolorfalse
% wenn key color, dann Farbe und Option shade=true an chemexec weitergeben
\define@key[MC]{mychemistry.sty}%
{color}{
\@usecolortrue
- \renewcommand{\@mc@exec@color}{#1}
- \renewcommand{\@mc@exec@shade}{true}
+ \renewcommand{\mC@exec@color}{#1}
+ \renewcommand{\mC@exec@shade}{true}
}
% sonst nicht:
\DeclareOptionX[MC]{nocolor}{
\@usecolortrue
- \renewcommand{\@mc@exec@color}{black}
- \renewcommand{\@mc@exec@shade}{false}
+ \renewcommand{\mC@exec@color}{black}
+ \renewcommand{\mC@exec@shade}{false}
}
% shade separat (de-)aktivieren
\DeclareOptionX[MC]{shade}{%
- \renewcommand{\@mc@exec@shade}{true}
+ \renewcommand{\mC@exec@shade}{true}
}
% chemexec abschalten
-\newcommand{\@mc@exec@true}{true}
+\newcommand{\mC@exec@true}{true}
\DeclareOptionX[MC]{nochemexec}{%
- \renewcommand{\@mc@exec@true}{false}
+ \renewcommand{\mC@exec@true}{false}
}
% mhchem abschalten
-\newcommand{\@mc@mhchem@true}{true}
+\newcommand{\mC@mhchem@true}{true}
\DeclareOptionX[MC]{nomhchem}{%
- \renewcommand{\@mc@mhchem@true}{false}
+ \renewcommand{\mC@mhchem@true}{false}
}
% chemcompounds abschalten
-\newcommand{\@mc@compound@true}{true}
+\newcommand{\mC@compound@true}{true}
\DeclareOptionX[MC]{nocompounds}{%
- \renewcommand{\@mc@compound@true}{false}
+ \renewcommand{\mC@compound@true}{false}
}
% chemstyle einschalten
-\newcommand{\@mc@chemstyle@true}{false}
+\newcommand{\mC@chemstyle@true}{false}
\DeclareOptionX[MC]{chemstyle}{%
- \renewcommand{\@mc@chemstyle@true}{true}
+ \renewcommand{\mC@chemstyle@true}{true}
}
% nur `chemfig' laden
\DeclareOptionX[MC]{nopackages}{%
- \renewcommand{\@mc@exec@true}{false}
- \renewcommand{\@mc@mhchem@true}{false}
- \renewcommand{\@mc@compound@true}{false}
- \renewcommand{\@mc@chemstyle@true}{false}
+ \renewcommand{\mC@exec@true}{false}
+ \renewcommand{\mC@mhchem@true}{false}
+ \renewcommand{\mC@compound@true}{false}
+ \renewcommand{\mC@chemstyle@true}{false}
}
% englische Version von chemexec, englische Variante von myChemistry
-\newcommand{\@mc@exec@english}{}
-\newcommand{\@mc@rs@name}{Reaktionsschema}
+\newcommand{\mC@exec@english}{}
+\newcommand{\mC@rs@name}{Reaktionsschema}
\DeclareOptionX[MC]{english}{
- \renewcommand{\@mc@exec@english}{,english}
- \renewcommand{\@mc@rs@name}{Reaction scheme}
+ \renewcommand{\mC@exec@english}{,english}
+ \renewcommand{\mC@rs@name}{Reaction scheme}
}
-\newcommand{\@mc@rs@placement}{H}
-\newcommand{\@mc@rs@currentplacement}{\@mc@rs@placement}
+\newcommand{\mC@rs@placement}{H}
+\newcommand{\mC@rs@currentplacement}{\mC@rs@placement}
\define@key[MC]{mychemistry.sty}{placement}{
- \renewcommand{\@mc@rs@placement}{#1}
+ \renewcommand{\mC@rs@placement}{#1}
}
\ProcessOptionsX[MC]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% chemstyle laden, falls verfügbar und Option aktiv
\IfFileExists{chemstyle.sty}{%
- \ifthenelse{\equal{\@mc@chemstyle@true}{true}}{
+ \ifthenelse{\equal{\mC@chemstyle@true}{true}}{
\@ifpackageloaded{chemstyle}{}{
\RequirePackage[varioref=false,floats=float]{chemstyle}
\PackageInfo{mychemistry}{You loaded `chemstyle' with options `varioref=false' and `floats=float'. Please be aware, that you might need to restyle the float `table'. Take a look at the `chemstyle' documentation for further information.}
@@ -151,13 +179,13 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% chemcompounds laden, falls verfügbar
\IfFileExists{chemcompounds.sty}{%
- \ifthenelse{\equal{\@mc@compound@true}{true}}{
+ \ifthenelse{\equal{\mC@compound@true}{true}}{
\@ifpackageloaded{chemcompounds}{}{
\RequirePackage{chemcompounds}
}
}{}
}{
- \typeout{`chemcompounds' is not installed.}
+ \PackageWarning{myChemistry: `chemcompounds' is not installed. You shoul use the `nocompounds' option.}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% chemfig laden, falls verfügbar
@@ -172,240 +200,265 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% chemexec laden, falls verfügbar, falls nicht, dann wenigstens mhchem laden
\IfFileExists{chemexec.sty}{% mit den Default-Optionen color=black, shade=false,exercise,exersize=large
- \ifthenelse{\equal{\@mc@exec@true}{true}}{
- \ifthenelse{\equal{\@mc@mhchem@true}{true}}{}{
+ \ifthenelse{\equal{\mC@exec@true}{true}}{
+ \ifthenelse{\equal{\mC@mhchem@true}{true}}{}{
\PackageWarning{mychemistry}{You used the option `nomhchem' but not `nochemexec'. Please be aware that `mhchem' is loaded by `chemexec' anyway.}
}
\@ifpackageloaded{chemexec}{}{
- \RequirePackage[color=\@mc@exec@color,shade=\@mc@exec@shade,exercise,exersize=large\@mc@exec@english]{chemexec}
+ \RequirePackage[color=\mC@exec@color,shade=\mC@exec@shade,exercise,exersize=large\mC@exec@english]{chemexec}
}
}{}
}{
- \typeout{`chemexec' ist not installed.}
+ \PackageWarning{myChemistry: `chemexec' ist not installed. You should use the `nochemexec' option.}
\IfFileExists{mhchem.sty}{
- \ifthenelse{\equal{\@mc@mhchem@true}{true}}{
+ \ifthenelse{\equal{\mC@mhchem@true}{true}}{
\@ifpackageloaded{mhchem}{}{
\RequirePackage[version=3]{mhchem}
}
}{}
}{
- \typeout{`mhchem' ist not installed.}
+ \PackageWarning{myChemistry: `mhchem' ist not installed. You should use the `nomhchem' option.}
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% NEUE BEFEHLE: %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\providecommand{\mCversion}{\@mc@version}
-\providecommand{\mCdate}[1]{
- \ifthenelse{\equal{#1}{de}}{\@mc@date@de}{}
- \ifthenelse{\equal{#1}{en}}{\@mc@date@en}{}
+% myChemistry Informationen ----------------------------------------------------------- %
+\mC@def\mCversion{\mC@version}
+\mC@def\mCdate#1{\csname mC@date@#1\endcsname}
+% additional für ChemFig v0.4 --------------------------------------------------------- %
+\mC@def\mC@CFversion@test{0.4}%
+\IfFileExists{bondwidth.tex}{%
+ \ifx\CF@ver\mC@CFversion@test\input{bondwidth}\fi
+}{}%
+% Optional Argument Analysis ---------------------------------------------------------- %
+% Prüfen ob #2 in #1 enthalten ist
+\mC@def\mC@if@instr#1#2{%
+ \def\mC@if@instr@i##1#2##2\@nil{\ifx\@empty##2\@empty\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}%
+ \mC@if@instr@i#1\@@nil#2\@nil
+}
+% Am ersten , splitten, #1 in #3 speichern, #2 in \mC@remainargs
+\mC@def\mC@splitfirst#1,#2\@nil#3{%
+ \def#3{#1}\def\mC@remainargs{#2}%
+}
+% ein durch , in 3 Teile getrenntes Argument splitten
+\mC@def\mC@splitarg#1{
+ \mC@if@instr{#1}{,}{\expandafter\mC@splitfirst#1\@nil\mC@firstarg}{\def\mC@firstarg{#1}}
+ \expandafter\mC@if@instr\expandafter{\mC@remainargs}{,}{\expandafter\mC@splitfirst\mC@remainargs\@nil\mC@secondarg}{\expandafter\def\expandafter\mC@secondarg\expandafter{\mC@remainargs}}
+ \ifx\mC@remainargs\mC@secondarg\let\mC@thirdarg\@empty\else\expandafter\def\expandafter\mC@thirdarg\expandafter{\mC@remainargs}\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PFEILE ------------------------------------------------------------------------------ %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% interne Befehle, Voreinstellungen --------------------------------------------------- %
-\newcommand{\@arrow@above}{above} % oben
-\newcommand{\@arrow@currentabove}{\@arrow@above} %
-\newcommand{\@arrow@below}{below} % unten
-\newcommand{\@arrow@currentbelow}{\@arrow@below} %
-\newcommand{\@arrow@direction}{right} % Richtung
-\newcommand{\@arrow@currentdirection}{\@arrow@direction}
-\newcommand{\@arrow@currentlength}{\@arrow@length}
-\newlength{\@arrow@length@actual}
-\newcommand{\@arrow@rotate}{}
-\newcommand{\@arrow@argument@angle}{}
-\newcommand{\@arrow@argument@shift}{2pt}
-\newcommand{\@arrow@argument@anchor}{}
-\newcommand{\@arrow@argument@both}{}
-%\newcommand{\@arrow@argument@size}{}
-\newcommand{\@arrow@above@anchor}{}
-\newcommand{\@arrow@below@anchor}{}
-\newcommand{\@arrow@type}{->} % Pfeiltyp
-\newcommand{\@arrow@currenttype}{\@arrow@type} %
-\newcommand{\@arrow@start@up}{0,0.05} % Verschiebung für Glgw-Pfeil
-\newcommand{\@arrow@start@down}{0,-0.05} %
-\newcommand{\@arrow@placement}{on chain=going \@arrow@currentdirection} % wohin?
-\newcommand{\@arrow@currentplacement}{\@arrow@placement}
-\newcommand{\@arrow@cross@base@x}{} % Befehle für durchgestrichenen Pfeil
-\newcommand{\@arrow@cross@base@y}{} %
-\newcommand{\@arrow@cross@angle}{} %
-\newcommand{\@arrow@cross@length}{} %
-\newcommand{\@arrow@cross@draw}{} %
+\newcommand{\mC@arrow@above}{above} % oben
+\newcommand{\mC@arrow@currentabove}{\mC@arrow@above} %
+\newcommand{\mC@arrow@below}{below} % unten
+\newcommand{\mC@arrow@currentbelow}{\mC@arrow@below} %
+\newcommand{\mC@arrow@direction}{right} % Richtung
+\newcommand{\mC@arrow@currentdirection}{\mC@arrow@direction}
+\newcommand{\mC@arrow@currentlength}{\mC@arrow@length}
+\newlength{\mC@arrow@length@actual}
+\newcommand{\mC@arrow@rotate}{}
+\newcommand{\mC@arrow@argument@angle}{}
+\newcommand{\mC@arrow@argument@shift}{2pt}
+\newcommand{\mC@arrow@argument@anchor}{}
+\newcommand{\mC@arrow@argument@both}{}
+\newcommand{\mC@arrow@above@anchor}{}
+\newcommand{\mC@arrow@below@anchor}{}
+\newcommand{\mC@arrow@type}{->} % Pfeiltyp
+\newcommand{\mC@arrow@currenttype}{\mC@arrow@type} %
+\newcommand{\mC@arrow@start@up}{0,0.05} % Verschiebung für Glgw-Pfeil
+\newcommand{\mC@arrow@start@down}{0,-0.05} %
+\newcommand{\mC@arrow@placement}{on chain=going \mC@arrow@currentdirection} % wohin?
+\newcommand{\mC@arrow@currentplacement}{\mC@arrow@placement}
+\newcommand{\mC@arrow@cross@base@x}{} % Befehle für durchgestrichenen Pfeil
+\newcommand{\mC@arrow@cross@base@y}{} %
+\newcommand{\mC@arrow@cross@angle}{} %
+\newcommand{\mC@arrow@cross@length}{} %
+\newcommand{\mC@arrow@cross@draw}{} %
% Laengenfaktor ----------------------------------------------------------------------- %
-\newcommand{\@arrow@length}{1.0} % Längenfaktor
-\newcommand{\@arrow@length@factor}{1.0} % Default-Faktor
-\newcommand{\@arrow@end}{\@arrow@length@actual,0} % Pfeilende
-\define@key{arrow}{length}[\@arrow@length]{% %
- \renewcommand{\@arrow@currentlength}{#1}}% %
-\newlength{\@arrow@length@default} %
-\setlength{\@arrow@length@default}{5em} % Default-Laenge
-\newcommand{\arrowlength}[1]{\setlength{\@arrow@length@default}{#1}}
+\newcommand{\mC@arrow@length}{1.0} % Längenfaktor
+\newcommand{\mC@arrow@length@factor}{1.0} % Default-Faktor
+\newcommand{\mC@arrow@end}{\mC@arrow@length@actual,0} % Pfeilende
+\define@key{arrow}{length}[\mC@arrow@length]{% %
+ \renewcommand{\mC@arrow@currentlength}{#1}}% %
+\newlength{\mC@arrow@length@default} %
+\setlength{\mC@arrow@length@default}{5em} % Default-Laenge
+\mC@def\setarrowlength#1{
+ \ifx\@empty#1\@empty
+ \setlength{\mC@arrow@length@default}{5em}
+ \else
+ \setlength{\mC@arrow@length@default}{#1}
+ \fi
+}
+\let\arrowlength\setarrowlength
% Beschriftungen ---------------------------------------------------------------------- %
-\newlength{\@arrow@argument@aboveshift} % Verschieben der Beschriftung
-\newlength{\@arrow@argument@belowshift} % Verschieben der Beschriftung
+\newlength{\mC@arrow@argument@aboveshift} % Verschieben der Beschriftung
+\newlength{\mC@arrow@argument@belowshift} % Verschieben der Beschriftung
\define@key{arrow}{aboveshift}[2pt]{%
- \setlength{\@arrow@argument@aboveshift}{#1}}
+ \setlength{\mC@arrow@argument@aboveshift}{#1}}
\define@key{arrow}{belowshift}[2pt]{%
- \setlength{\@arrow@argument@belowshift}{#1}}
+ \setlength{\mC@arrow@argument@belowshift}{#1}}
\define@key{arrow}{both}[]{
- \renewcommand{\@arrow@argument@both}{true}
+ \renewcommand{\mC@arrow@argument@both}{true}
}
% Anker ------------------------------------------------------------------------------- %
-\newcommand{\@arrow@name}{} % Anker
-\newcommand{\@arrow@currentname}{\@arrow@name} %
-\define@key{arrow}{name}[\@arrow@name]{% %
- \renewcommand{\@arrow@currentname}{#1}}% %
+\newcommand{\mC@arrow@name}{} % Anker
+\newcommand{\mC@arrow@currentname}{\mC@arrow@name} %
+\define@key{arrow}{name}[\mC@arrow@name]{% %
+ \renewcommand{\mC@arrow@currentname}{#1}}% %
% Richtung ---------------------------------------------------------------------------- %
-\define@key{arrow}{direction}[\@arrow@direction]{%
- \renewcommand{\@arrow@currentdirection}{#1} %
+\define@key{arrow}{direction}[\mC@arrow@direction]{%
+ \renewcommand{\mC@arrow@currentdirection}{#1} %
\ifthenelse{\equal{#1}{right}}{% nach rechts, Einstellungen:
- \renewcommand{\@arrow@end}{\@arrow@length@actual,0}
- \renewcommand{\@arrow@currentabove}{above}
- \renewcommand{\@arrow@currentbelow}{below}
- \renewcommand{\@arrow@above@anchor}{south}
- \renewcommand{\@arrow@below@anchor}{north}
- \renewcommand{\@arrow@argument@anchor}{
- \node(@arrow@center) at ($(\tikzchainprevious.east)+(.5\@arrow@length@actual+\@rxn@node@distance,0)$) {};
+ \renewcommand{\mC@arrow@end}{\mC@arrow@length@actual,0}
+ \renewcommand{\mC@arrow@currentabove}{above}
+ \renewcommand{\mC@arrow@currentbelow}{below}
+ \renewcommand{\mC@arrow@above@anchor}{south}
+ \renewcommand{\mC@arrow@below@anchor}{north}
+ \renewcommand{\mC@arrow@argument@anchor}{
+ \node(@arrow@center) at ($(\tikzchainprevious.east)+(.5\mC@arrow@length@actual+\mC@rxn@node@distance,0)$) {};
}
- \renewcommand{\@arrow@argument@angle}{0}
- \renewcommand{\@arrow@rotate}{0}
- \renewcommand{\@arrow@start@up}{0,0.03}
- \renewcommand{\@arrow@start@down}{0,-0.03}
- \renewcommand{\@arrow@cross@base@x}{.15em}
- \renewcommand{\@arrow@cross@base@y}{0}
- \renewcommand{\@arrow@cross@angle}{60}
- \renewcommand{\@arrow@cross@length}{.5em}
+ \renewcommand{\mC@arrow@argument@angle}{0}
+ \renewcommand{\mC@arrow@rotate}{0}
+ \renewcommand{\mC@arrow@start@up}{0,0.03}
+ \renewcommand{\mC@arrow@start@down}{0,-0.03}
+ \renewcommand{\mC@arrow@cross@base@x}{.15em}
+ \renewcommand{\mC@arrow@cross@base@y}{0}
+ \renewcommand{\mC@arrow@cross@angle}{60}
+ \renewcommand{\mC@arrow@cross@length}{.5em}
}{
\ifthenelse{\equal{#1}{above right}}{% nach oben rechts, Einstellungen:
- \renewcommand{\@arrow@end}{\@arrow@length@actual,\@arrow@length@actual}
- \renewcommand{\@arrow@currentabove}{above left}
- \renewcommand{\@arrow@currentbelow}{below right}
- \renewcommand{\@arrow@above@anchor}{south}
- \renewcommand{\@arrow@below@anchor}{north}
- \renewcommand{\@arrow@argument@anchor}{
- \node(@arrow@center) at ($(\tikzchainprevious.north east)+(.5\@arrow@length@actual+.707\@rxn@node@distance,.5\@arrow@length@actual+.707\@rxn@node@distance)$) {};
+ \renewcommand{\mC@arrow@end}{\mC@arrow@length@actual,\mC@arrow@length@actual}
+ \renewcommand{\mC@arrow@currentabove}{above left}
+ \renewcommand{\mC@arrow@currentbelow}{below right}
+ \renewcommand{\mC@arrow@above@anchor}{south}
+ \renewcommand{\mC@arrow@below@anchor}{north}
+ \renewcommand{\mC@arrow@argument@anchor}{
+ \node(@arrow@center) at ($(\tikzchainprevious.north east)+(.5\mC@arrow@length@actual+.707\mC@rxn@node@distance,.5\mC@arrow@length@actual+.707\mC@rxn@node@distance)$) {};
}
- \renewcommand{\@arrow@argument@angle}{45}
- \renewcommand{\@arrow@rotate}{45}
- \renewcommand{\@arrow@start@up}{-0.02,0.02}
- \renewcommand{\@arrow@start@down}{0.02,-0.02}
- \renewcommand{\@arrow@cross@base@x}{.1em}
- \renewcommand{\@arrow@cross@base@y}{.1em}
- \renewcommand{\@arrow@cross@angle}{-15}
- \renewcommand{\@arrow@cross@length}{.7em}
+ \renewcommand{\mC@arrow@argument@angle}{45}
+ \renewcommand{\mC@arrow@rotate}{45}
+ \renewcommand{\mC@arrow@start@up}{-0.02,0.02}
+ \renewcommand{\mC@arrow@start@down}{0.02,-0.02}
+ \renewcommand{\mC@arrow@cross@base@x}{.1em}
+ \renewcommand{\mC@arrow@cross@base@y}{.1em}
+ \renewcommand{\mC@arrow@cross@angle}{-15}
+ \renewcommand{\mC@arrow@cross@length}{.7em}
}{
\ifthenelse{\equal{#1}{above}}{% nach oben, Einstellungen:
- \renewcommand{\@arrow@end}{0,\@arrow@length@actual}
- \renewcommand{\@arrow@currentabove}{left}
- \renewcommand{\@arrow@currentbelow}{right}
- \renewcommand{\@arrow@above@anchor}{east}
- \renewcommand{\@arrow@below@anchor}{west}
- \renewcommand{\@arrow@argument@anchor}{
- \node(@arrow@center) at ($(\tikzchainprevious.north)+(0,.5\@arrow@length@actual+\@rxn@node@distance)$) {};
+ \renewcommand{\mC@arrow@end}{0,\mC@arrow@length@actual}
+ \renewcommand{\mC@arrow@currentabove}{left}
+ \renewcommand{\mC@arrow@currentbelow}{right}
+ \renewcommand{\mC@arrow@above@anchor}{east}
+ \renewcommand{\mC@arrow@below@anchor}{west}
+ \renewcommand{\mC@arrow@argument@anchor}{
+ \node(@arrow@center) at ($(\tikzchainprevious.north)+(0,.5\mC@arrow@length@actual+\mC@rxn@node@distance)$) {};
}
- \renewcommand{\@arrow@argument@angle}{90}
- \renewcommand{\@arrow@rotate}{0}
- \renewcommand{\@arrow@start@up}{-0.03,0}
- \renewcommand{\@arrow@start@down}{0.03,0}
- \renewcommand{\@arrow@cross@base@x}{0}
- \renewcommand{\@arrow@cross@base@y}{.15em}
- \renewcommand{\@arrow@cross@angle}{30}
- \renewcommand{\@arrow@cross@length}{.5em}
+ \renewcommand{\mC@arrow@argument@angle}{90}
+ \renewcommand{\mC@arrow@rotate}{0}
+ \renewcommand{\mC@arrow@start@up}{-0.03,0}
+ \renewcommand{\mC@arrow@start@down}{0.03,0}
+ \renewcommand{\mC@arrow@cross@base@x}{0}
+ \renewcommand{\mC@arrow@cross@base@y}{.15em}
+ \renewcommand{\mC@arrow@cross@angle}{30}
+ \renewcommand{\mC@arrow@cross@length}{.5em}
}{
\ifthenelse{\equal{#1}{above left}}{% nach oben links, Einstellungen:
- \renewcommand{\@arrow@end}{-\@arrow@length@actual,\@arrow@length@actual}
- \renewcommand{\@arrow@currentabove}{above right}
- \renewcommand{\@arrow@currentbelow}{below left}
- \renewcommand{\@arrow@above@anchor}{south}
- \renewcommand{\@arrow@below@anchor}{north}
- \renewcommand{\@arrow@argument@anchor}{
- \node(@arrow@center) at ($(\tikzchainprevious.north west)+(-.5\@arrow@length@actual-.707\@rxn@node@distance,.5\@arrow@length@actual+.707\@rxn@node@distance)$) {};
+ \renewcommand{\mC@arrow@end}{-\mC@arrow@length@actual,\mC@arrow@length@actual}
+ \renewcommand{\mC@arrow@currentabove}{above right}
+ \renewcommand{\mC@arrow@currentbelow}{below left}
+ \renewcommand{\mC@arrow@above@anchor}{south}
+ \renewcommand{\mC@arrow@below@anchor}{north}
+ \renewcommand{\mC@arrow@argument@anchor}{
+ \node(@arrow@center) at ($(\tikzchainprevious.north west)+(-.5\mC@arrow@length@actual-.707\mC@rxn@node@distance,.5\mC@arrow@length@actual+.707\mC@rxn@node@distance)$) {};
}
- \renewcommand{\@arrow@argument@angle}{-45}
- \renewcommand{\@arrow@rotate}{-45}
- \renewcommand{\@arrow@start@up}{-0.02,-0.02}
- \renewcommand{\@arrow@start@down}{0.02,0.02}
- \renewcommand{\@arrow@cross@base@x}{-.1em}
- \renewcommand{\@arrow@cross@base@y}{.1em}
- \renewcommand{\@arrow@cross@angle}{15}
- \renewcommand{\@arrow@cross@length}{.7em}
+ \renewcommand{\mC@arrow@argument@angle}{-45}
+ \renewcommand{\mC@arrow@rotate}{-45}
+ \renewcommand{\mC@arrow@start@up}{-0.02,-0.02}
+ \renewcommand{\mC@arrow@start@down}{0.02,0.02}
+ \renewcommand{\mC@arrow@cross@base@x}{-.1em}
+ \renewcommand{\mC@arrow@cross@base@y}{.1em}
+ \renewcommand{\mC@arrow@cross@angle}{15}
+ \renewcommand{\mC@arrow@cross@length}{.7em}
}{
\ifthenelse{\equal{#1}{left}}{% nach links, Einstellungen:
- \renewcommand{\@arrow@end}{-\@arrow@length@actual,0}
- \renewcommand{\@arrow@currentabove}{above}
- \renewcommand{\@arrow@currentbelow}{below}
- \renewcommand{\@arrow@above@anchor}{south}
- \renewcommand{\@arrow@below@anchor}{north}
- \renewcommand{\@arrow@argument@anchor}{
- \node(@arrow@center) at ($(\tikzchainprevious.west)+(-.5\@arrow@length@actual-\@rxn@node@distance,0)$) {};
+ \renewcommand{\mC@arrow@end}{-\mC@arrow@length@actual,0}
+ \renewcommand{\mC@arrow@currentabove}{above}
+ \renewcommand{\mC@arrow@currentbelow}{below}
+ \renewcommand{\mC@arrow@above@anchor}{south}
+ \renewcommand{\mC@arrow@below@anchor}{north}
+ \renewcommand{\mC@arrow@argument@anchor}{
+ \node(@arrow@center) at ($(\tikzchainprevious.west)+(-.5\mC@arrow@length@actual-\mC@rxn@node@distance,0)$) {};
}
- \renewcommand{\@arrow@argument@angle}{0}
- \renewcommand{\@arrow@rotate}{0}
- \renewcommand{\@arrow@start@up}{0,-0.03}
- \renewcommand{\@arrow@start@down}{0,0.03}
- \renewcommand{\@arrow@cross@base@x}{.15em}
- \renewcommand{\@arrow@cross@base@y}{0}
- \renewcommand{\@arrow@cross@angle}{60}
- \renewcommand{\@arrow@cross@length}{.5em}
+ \renewcommand{\mC@arrow@argument@angle}{0}
+ \renewcommand{\mC@arrow@rotate}{0}
+ \renewcommand{\mC@arrow@start@up}{0,-0.03}
+ \renewcommand{\mC@arrow@start@down}{0,0.03}
+ \renewcommand{\mC@arrow@cross@base@x}{.15em}
+ \renewcommand{\mC@arrow@cross@base@y}{0}
+ \renewcommand{\mC@arrow@cross@angle}{60}
+ \renewcommand{\mC@arrow@cross@length}{.5em}
}{
\ifthenelse{\equal{#1}{below left}}{% nach unten links, Einstellungen:
- \renewcommand{\@arrow@end}{-\@arrow@length@actual,-\@arrow@length@actual}
- \renewcommand{\@arrow@currentabove}{above left}
- \renewcommand{\@arrow@currentbelow}{below right}
- \renewcommand{\@arrow@above@anchor}{south}
- \renewcommand{\@arrow@below@anchor}{north}
- \renewcommand{\@arrow@argument@anchor}{
- \node(@arrow@center) at ($(\tikzchainprevious.south west)+(-.5\@arrow@length@actual-.707\@rxn@node@distance,-.5\@arrow@length@actual-.707\@rxn@node@distance)$) {};
+ \renewcommand{\mC@arrow@end}{-\mC@arrow@length@actual,-\mC@arrow@length@actual}
+ \renewcommand{\mC@arrow@currentabove}{above left}
+ \renewcommand{\mC@arrow@currentbelow}{below right}
+ \renewcommand{\mC@arrow@above@anchor}{south}
+ \renewcommand{\mC@arrow@below@anchor}{north}
+ \renewcommand{\mC@arrow@argument@anchor}{
+ \node(@arrow@center) at ($(\tikzchainprevious.south west)+(-.5\mC@arrow@length@actual-.707\mC@rxn@node@distance,-.5\mC@arrow@length@actual-.707\mC@rxn@node@distance)$) {};
}
- \renewcommand{\@arrow@argument@angle}{45}
- \renewcommand{\@arrow@rotate}{45}
- \renewcommand{\@arrow@start@up}{0.02,-0.02}
- \renewcommand{\@arrow@start@down}{-0.02,0.02}
- \renewcommand{\@arrow@cross@base@x}{.1em}
- \renewcommand{\@arrow@cross@base@y}{.1em}
- \renewcommand{\@arrow@cross@angle}{-15}
- \renewcommand{\@arrow@cross@length}{.7em}
+ \renewcommand{\mC@arrow@argument@angle}{45}
+ \renewcommand{\mC@arrow@rotate}{45}
+ \renewcommand{\mC@arrow@start@up}{0.02,-0.02}
+ \renewcommand{\mC@arrow@start@down}{-0.02,0.02}
+ \renewcommand{\mC@arrow@cross@base@x}{.1em}
+ \renewcommand{\mC@arrow@cross@base@y}{.1em}
+ \renewcommand{\mC@arrow@cross@angle}{-15}
+ \renewcommand{\mC@arrow@cross@length}{.7em}
}{
\ifthenelse{\equal{#1}{below}}{% nach unten, Einstellungen:
- \renewcommand{\@arrow@end}{0,-\@arrow@length@actual}
- \renewcommand{\@arrow@currentabove}{left}
- \renewcommand{\@arrow@currentbelow}{right}
- \renewcommand{\@arrow@above@anchor}{east}
- \renewcommand{\@arrow@below@anchor}{west}
- \renewcommand{\@arrow@argument@anchor}{
- \node(@arrow@center) at ($(\tikzchainprevious.south)+(0,-.5\@arrow@length@actual-\@rxn@node@distance)$) {};
+ \renewcommand{\mC@arrow@end}{0,-\mC@arrow@length@actual}
+ \renewcommand{\mC@arrow@currentabove}{left}
+ \renewcommand{\mC@arrow@currentbelow}{right}
+ \renewcommand{\mC@arrow@above@anchor}{east}
+ \renewcommand{\mC@arrow@below@anchor}{west}
+ \renewcommand{\mC@arrow@argument@anchor}{
+ \node(@arrow@center) at ($(\tikzchainprevious.south)+(0,-.5\mC@arrow@length@actual-\mC@rxn@node@distance)$) {};
}
- \renewcommand{\@arrow@argument@angle}{90}
- \renewcommand{\@arrow@rotate}{0}
- \renewcommand{\@arrow@start@up}{0.03,0}
- \renewcommand{\@arrow@start@down}{-0.03,0}
- \renewcommand{\@arrow@cross@base@x}{0}
- \renewcommand{\@arrow@cross@base@y}{.15em}
- \renewcommand{\@arrow@cross@angle}{30}
- \renewcommand{\@arrow@cross@length}{.5em}
+ \renewcommand{\mC@arrow@argument@angle}{90}
+ \renewcommand{\mC@arrow@rotate}{0}
+ \renewcommand{\mC@arrow@start@up}{0.03,0}
+ \renewcommand{\mC@arrow@start@down}{-0.03,0}
+ \renewcommand{\mC@arrow@cross@base@x}{0}
+ \renewcommand{\mC@arrow@cross@base@y}{.15em}
+ \renewcommand{\mC@arrow@cross@angle}{30}
+ \renewcommand{\mC@arrow@cross@length}{.5em}
}{
\ifthenelse{\equal{#1}{below right}}{% nach unten rechts, Einstellungen:
- \renewcommand{\@arrow@end}{\@arrow@length@actual,-\@arrow@length@actual}
- \renewcommand{\@arrow@currentabove}{above right}
- \renewcommand{\@arrow@currentbelow}{below left}
- \renewcommand{\@arrow@above@anchor}{south}
- \renewcommand{\@arrow@below@anchor}{north}
- \renewcommand{\@arrow@argument@anchor}{
- \node(@arrow@center) at ($(\tikzchainprevious.south east)+(.5\@arrow@length@actual+.707\@rxn@node@distance,-.5\@arrow@length@actual-.707\@rxn@node@distance)$) {};
+ \renewcommand{\mC@arrow@end}{\mC@arrow@length@actual,-\mC@arrow@length@actual}
+ \renewcommand{\mC@arrow@currentabove}{above right}
+ \renewcommand{\mC@arrow@currentbelow}{below left}
+ \renewcommand{\mC@arrow@above@anchor}{south}
+ \renewcommand{\mC@arrow@below@anchor}{north}
+ \renewcommand{\mC@arrow@argument@anchor}{
+ \node(@arrow@center) at ($(\tikzchainprevious.south east)+(.5\mC@arrow@length@actual+.707\mC@rxn@node@distance,-.5\mC@arrow@length@actual-.707\mC@rxn@node@distance)$) {};
}
- \renewcommand{\@arrow@argument@angle}{-45}
- \renewcommand{\@arrow@rotate}{-45}
- \renewcommand{\@arrow@start@up}{0.02,0.02}
- \renewcommand{\@arrow@start@down}{-0.02,-0.02}
- \renewcommand{\@arrow@cross@base@x}{-.1em}
- \renewcommand{\@arrow@cross@base@y}{.1em}
- \renewcommand{\@arrow@cross@angle}{15}
- \renewcommand{\@arrow@cross@length}{.7em}
+ \renewcommand{\mC@arrow@argument@angle}{-45}
+ \renewcommand{\mC@arrow@rotate}{-45}
+ \renewcommand{\mC@arrow@start@up}{0.02,0.02}
+ \renewcommand{\mC@arrow@start@down}{-0.02,-0.02}
+ \renewcommand{\mC@arrow@cross@base@x}{-.1em}
+ \renewcommand{\mC@arrow@cross@base@y}{.1em}
+ \renewcommand{\mC@arrow@cross@angle}{15}
+ \renewcommand{\mC@arrow@cross@length}{.7em}
}{
\PackageError{mychemistry}{Unknown arrow direction}% oder Fehler
}
@@ -419,26 +472,26 @@
}
% Pfeiltyp ---------------------------------------------------------------------------- %
-\newcommand{\@arrow@drawing}{}
-\define@key{arrow}{type}[\@arrow@type]{%
- \renewcommand{\@arrow@currenttype}{#1}
+\newcommand{\mC@arrow@drawing}{}
+\define@key{arrow}{type}[\mC@arrow@type]{%
+ \renewcommand{\mC@arrow@currenttype}{#1}
\ifthenelse{\equal{#1}{->}}{
- \renewcommand{\@arrow@drawing}{\draw[->,thick,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\@arrow@end);}
+ \renewcommand{\mC@arrow@drawing}{\draw[->,thick,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);}
}{
\ifthenelse{\equal{#1}{<->}}{
- \renewcommand{\@arrow@drawing}{\draw[<->,thick,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\@arrow@end);}
+ \renewcommand{\mC@arrow@drawing}{\draw[<->,thick,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);}
}{
\ifthenelse{\equal{#1}{<-}}{
- \renewcommand{\@arrow@drawing}{\draw[<-,thick,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\@arrow@end);}
+ \renewcommand{\mC@arrow@drawing}{\draw[<-,thick,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);}
}{
\ifthenelse{\equal{#1}{<=>}}{
- \renewcommand{\@arrow@drawing}{\draw[-left to,thick,text height=0] (\@arrow@start@up) -- ++(\@arrow@end);\draw[left to-,thick,text height=0] (\@arrow@start@down) -- ++(\@arrow@end);\draw[draw=none] (0,0) -- node[pos=.5](@arrow@center){} ++(\@arrow@end);}
+ \renewcommand{\mC@arrow@drawing}{\draw[-left to,thick,text height=0] (\mC@arrow@start@up) -- ++(\mC@arrow@end);\draw[left to-,thick,text height=0] (\mC@arrow@start@down) -- ++(\mC@arrow@end);\draw[draw=none] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);}
}{
\ifthenelse{\equal{#1}{-|>}}{
- \setlength{\@arrow@argument@aboveshift}{.75em}
- \setlength{\@arrow@argument@belowshift}{.75em}
- \renewcommand{\@arrow@cross@draw}{\draw[thick] ($(@arrow@center.base) + (\@arrow@cross@base@x,\@arrow@cross@base@y) + (\@arrow@cross@angle:\@arrow@cross@length)$) -- ($(@arrow@center.base) + (\@arrow@cross@base@x,\@arrow@cross@base@y) + (\@arrow@cross@angle-180:\@arrow@cross@length)$);\draw[thick] ($(@arrow@center.base) + (-\@arrow@cross@base@x,-\@arrow@cross@base@y) + (\@arrow@cross@angle:\@arrow@cross@length)$) -- ($(@arrow@center.base) + (-\@arrow@cross@base@x,-\@arrow@cross@base@y) + (\@arrow@cross@angle-180:\@arrow@cross@length)$);}
- \renewcommand{\@arrow@drawing}{\draw[->,thick,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\@arrow@end);\@arrow@cross@draw}
+ \setlength{\mC@arrow@argument@aboveshift}{.75em}
+ \setlength{\mC@arrow@argument@belowshift}{.75em}
+ \renewcommand{\mC@arrow@cross@draw}{\draw[thick] ($(@arrow@center.base) + (\mC@arrow@cross@base@x,\mC@arrow@cross@base@y) + (\mC@arrow@cross@angle:\mC@arrow@cross@length)$) -- ($(@arrow@center.base) + (\mC@arrow@cross@base@x,\mC@arrow@cross@base@y) + (\mC@arrow@cross@angle-180:\mC@arrow@cross@length)$);\draw[thick] ($(@arrow@center.base) + (-\mC@arrow@cross@base@x,-\mC@arrow@cross@base@y) + (\mC@arrow@cross@angle:\mC@arrow@cross@length)$) -- ($(@arrow@center.base) + (-\mC@arrow@cross@base@x,-\mC@arrow@cross@base@y) + (\mC@arrow@cross@angle-180:\mC@arrow@cross@length)$);}
+ \renewcommand{\mC@arrow@drawing}{\draw[->,thick,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);\mC@arrow@cross@draw}
}{
\PackageError{mychemistry}{Unknown arrow type}% oder Fehler
}
@@ -449,119 +502,119 @@
}%
% ------------------------------------------------------------------------------------- %
% Maße der Nodes der Pfeilargumente bestimmen, größere später an Pfeil weitergeben
-\newlength{\@mc@height@A}
-\newlength{\@mc@height@B}
-\newlength{\@arrow@argument@height}
-\newlength{\@mc@width@A}
-\newlength{\@mc@width@B}
-\newlength{\@arrow@argument@width}
-\newcommand{\@mc@savenode}{%
- \global\let\@mc@minx=\pgfpositionnodelaterminx%
- \global\let\@mc@maxx=\pgfpositionnodelatermaxx%
- \global\let\@mc@miny=\pgfpositionnodelaterminy%
- \global\let\@mc@maxy=\pgfpositionnodelatermaxy%
+\newlength{\mC@height@A}
+\newlength{\mC@height@B}
+\newlength{\mC@arrow@argument@height}
+\newlength{\mC@width@A}
+\newlength{\mC@width@B}
+\newlength{\mC@arrow@argument@width}
+\newcommand{\mC@savenode}{%
+ \global\let\mC@minx=\pgfpositionnodelaterminx%
+ \global\let\mC@maxx=\pgfpositionnodelatermaxx%
+ \global\let\mC@miny=\pgfpositionnodelaterminy%
+ \global\let\mC@maxy=\pgfpositionnodelatermaxy%
}%
% der nächste Befehl benötigt pgf v2.10!
-\newcommand{\@mc@largernode}[2]{
+\newcommand{\mC@largernode}[2]{
\@ifundefined{pgfpositionnodelater}{
\PackageError{mychemistry}{The command \string\pgfpositionnodelater is undefined. Make sure, you have installed the latest version of pgf.}
}{}
- {\pgfpositionnodelater{\@mc@savenode}
+ {\pgfpositionnodelater{\mC@savenode}
\node{#1};
- \setlength{\@mc@width@A}{\@mc@maxx}%
- \addtolength{\@mc@width@A}{-\@mc@minx}
- \setlength{\@mc@height@A}{\@mc@maxy}%
- \addtolength{\@mc@height@A}{-\@mc@miny}
+ \setlength{\mC@width@A}{\mC@maxx}%
+ \addtolength{\mC@width@A}{-\mC@minx}
+ \setlength{\mC@height@A}{\mC@maxy}%
+ \addtolength{\mC@height@A}{-\mC@miny}
\node{#2};
- \setlength{\@mc@width@B}{\@mc@maxx}%
- \addtolength{\@mc@width@B}{-\@mc@minx}
- \setlength{\@mc@height@B}{\@mc@maxy}%
- \addtolength{\@mc@height@B}{-\@mc@miny}
- \pgfmathsetlength{\@arrow@argument@width}{max(\@mc@width@A,\@mc@width@B)}
- \pgfmathsetlength{\@arrow@argument@height}{max(\@mc@height@A,\@mc@height@B)}
- \global\@arrow@argument@width=\@arrow@argument@width
- \global\@arrow@argument@height=\@arrow@argument@height
+ \setlength{\mC@width@B}{\mC@maxx}%
+ \addtolength{\mC@width@B}{-\mC@minx}
+ \setlength{\mC@height@B}{\mC@maxy}%
+ \addtolength{\mC@height@B}{-\mC@miny}
+ \pgfmathsetlength{\mC@arrow@argument@width}{max(\mC@width@A,\mC@width@B)}
+ \pgfmathsetlength{\mC@arrow@argument@height}{max(\mC@height@A,\mC@height@B)}
+ \global\mC@arrow@argument@width=\mC@arrow@argument@width
+ \global\mC@arrow@argument@height=\mC@arrow@argument@height
}
}
% Pfeil zeichnen ---------------------------------------------------------------------- %
-\newcommand{\@arrow}[3][]{
- \renewcommand{\@arrow@length@factor}{\@arrow@currentlength}
- \setlength{\@arrow@length@actual}{\@arrow@currentlength\@arrow@length@default}
- \ifthenelse{\equal{\@arrow@argument@both}{true}}{
- \@mc@largernode{#2}{#3}
+\newcommand{\mC@arrow}[3][]{
+ \renewcommand{\mC@arrow@length@factor}{\mC@arrow@currentlength}
+ \setlength{\mC@arrow@length@actual}{\mC@arrow@currentlength\mC@arrow@length@default}
+ \ifthenelse{\equal{\mC@arrow@argument@both}{true}}{
+ \mC@largernode{#2}{#3}
}{
- \setlength{\@arrow@argument@width}{0pt}
- \setlength{\@arrow@argument@height}{0pt}
+ \setlength{\mC@arrow@argument@width}{0pt}
+ \setlength{\mC@arrow@argument@height}{0pt}
}
- \draw node[on chain=going \@arrow@currentdirection](\@arrow@currentname) {\tikz{
- \@arrow@drawing
+ \draw node[on chain=going \mC@arrow@currentdirection](\mC@arrow@currentname) {\tikz{
+ \mC@arrow@drawing
}
};
- \@arrow@argument@anchor
- \draw node[anchor=\@arrow@above@anchor,rotate=\@arrow@rotate,minimum width=\@arrow@argument@width, minimum height=\@arrow@argument@height]
- at ($(@arrow@center.base)+(90+\@arrow@argument@angle:\@arrow@argument@aboveshift)$) {#2};
- \draw node[anchor=\@arrow@below@anchor,rotate=\@arrow@rotate,minimum width=\@arrow@argument@width, minimum height=\@arrow@argument@height]
- at ($(@arrow@center.base)+(-90+\@arrow@argument@angle:\@arrow@argument@belowshift)$) {#3};
- \setlength{\@arrow@argument@aboveshift}{2pt}
- \setlength{\@arrow@argument@belowshift}{2pt}
+ \mC@arrow@argument@anchor
+ \draw node[anchor=\mC@arrow@above@anchor,rotate=\mC@arrow@rotate,minimum width=\mC@arrow@argument@width, minimum height=\mC@arrow@argument@height]
+ at ($(@arrow@center.base)+(90+\mC@arrow@argument@angle:\mC@arrow@argument@aboveshift)$) {#2};
+ \draw node[anchor=\mC@arrow@below@anchor,rotate=\mC@arrow@rotate,minimum width=\mC@arrow@argument@width, minimum height=\mC@arrow@argument@height]
+ at ($(@arrow@center.base)+(-90+\mC@arrow@argument@angle:\mC@arrow@argument@belowshift)$) {#3};
+ \setlength{\mC@arrow@argument@aboveshift}{2pt}
+ \setlength{\mC@arrow@argument@belowshift}{2pt}
}
% Voreinstellungen:
\presetkeys%
{arrow}
- {direction=\@arrow@direction,length=\@arrow@length,type=\@arrow@type,aboveshift=\@arrow@argument@shift,belowshift=\@arrow@argument@shift}
+ {direction=\mC@arrow@direction,length=\mC@arrow@length,type=\mC@arrow@type,aboveshift=\mC@arrow@argument@shift,belowshift=\mC@arrow@argument@shift}
{}
% Eigentlicher Befehl:
\providecommand{\arrow}[3][]{
\setkeys{arrow}{#1}
- \@arrow{#2}{#3}
+ \mC@arrow{#2}{#3}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MERGE ------------------------------------------------------------------------------- %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand{\@merge@direction}{below}
-\newcommand{\@merge@to}{}
-\newcommand{\@merge@from@one}{}
-\newcommand{\@merge@from@two}{}
-\newcommand{\@merge}[3]{
- \renewcommand{\@merge@to}{#1}
- \renewcommand{\@merge@from@one}{#2}
- \renewcommand{\@merge@from@two}{#3}
+\newcommand{\mC@merge@direction}{below}
+\newcommand{\mC@merge@to}{}
+\newcommand{\mC@merge@from@one}{}
+\newcommand{\mC@merge@from@two}{}
+\newcommand{\mC@merge}[3]{
+ \renewcommand{\mC@merge@to}{#1}
+ \renewcommand{\mC@merge@from@one}{#2}
+ \renewcommand{\mC@merge@from@two}{#3}
}
% Basisbefehle ------------------------------------------------------------------------ %
-\newcommand{\@merge@right}{
- \draw[stealth-,thick] ($(\@merge@to.west)+(-1em,0)$) -- ($(\@merge@to.west)+(-4em,0)$) node(crossing) {};
- \draw[thick] ($(\@merge@from@one.east)+(1em,0)$) -| (crossing.base);
- \draw[thick] ($(\@merge@from@two.east)+(1em,0)$) -| (crossing.base);
-}
-\newcommand{\@merge@above}{
- \draw[stealth-,thick] ($(\@merge@to.south)+(0,-1em)$) -- ($(\@merge@to.south)+(0,-4em)$) node(crossing) {};
- \draw[thick] (crossing.base) -| ($(\@merge@from@one.north)+(0,1em)$);
- \draw[thick] (crossing.base) -| ($(\@merge@from@two.north)+(0,1em)$);
-}
-\newcommand{\@merge@left}{
- \draw[stealth-,thick] ($(\@merge@to.east)+(1em,0)$) -- ($(\@merge@to.east)+(4em,0)$) node(crossing) {};
- \draw[thick] ($(\@merge@from@one.west)+(-1em,0)$) -| (crossing.base);
- \draw[thick] ($(\@merge@from@two.west)+(-1em,0)$) -| (crossing.base);;
-}
-\newcommand{\@merge@below}[3]{
- \draw[stealth-,thick] ($(\@merge@to.north)+(0,1em)$) -- ($(\@merge@to.north)+(0,4em)$) node(crossing) {};
- \draw[thick] (crossing.base) -| ($(\@merge@from@one.south)+(0,-1em)$);
- \draw[thick] (crossing.base) -| ($(\@merge@from@two.south)+(0,-1em)$);
+\newcommand{\mC@merge@right}{
+ \draw[stealth-,thick] ($(\mC@merge@to.west)+(-1em,0)$) -- ($(\mC@merge@to.west)+(-4em,0)$) node(crossing) {};
+ \draw[thick] ($(\mC@merge@from@one.east)+(1em,0)$) -| (crossing.base);
+ \draw[thick] ($(\mC@merge@from@two.east)+(1em,0)$) -| (crossing.base);
+}
+\newcommand{\mC@merge@above}{
+ \draw[stealth-,thick] ($(\mC@merge@to.south)+(0,-1em)$) -- ($(\mC@merge@to.south)+(0,-4em)$) node(crossing) {};
+ \draw[thick] (crossing.base) -| ($(\mC@merge@from@one.north)+(0,1em)$);
+ \draw[thick] (crossing.base) -| ($(\mC@merge@from@two.north)+(0,1em)$);
+}
+\newcommand{\mC@merge@left}{
+ \draw[stealth-,thick] ($(\mC@merge@to.east)+(1em,0)$) -- ($(\mC@merge@to.east)+(4em,0)$) node(crossing) {};
+ \draw[thick] ($(\mC@merge@from@one.west)+(-1em,0)$) -| (crossing.base);
+ \draw[thick] ($(\mC@merge@from@two.west)+(-1em,0)$) -| (crossing.base);;
+}
+\newcommand{\mC@merge@below}[3]{
+ \draw[stealth-,thick] ($(\mC@merge@to.north)+(0,1em)$) -- ($(\mC@merge@to.north)+(0,4em)$) node(crossing) {};
+ \draw[thick] (crossing.base) -| ($(\mC@merge@from@one.south)+(0,-1em)$);
+ \draw[thick] (crossing.base) -| ($(\mC@merge@from@two.south)+(0,-1em)$);
}
% key zur Auswahl --------------------------------------------------------------------- %
\define@choicekey{merge}{direction}[\val\nr]{right,above,left,below}[below]{
\ifcase\nr\relax
- \@merge@right
+ \mC@merge@right
\or
- \@merge@above
+ \mC@merge@above
\or
- \@merge@left
+ \mC@merge@left
\or
- \@merge@below
+ \mC@merge@below
\fi
}
% Voreinstellung ---------------------------------------------------------------------- %
@@ -571,132 +624,122 @@
{}
% eigentlicher Befehl ----------------------------------------------------------------- %
\newcommand{\merge}[4][]{
- \@merge{#2}{#3}{#4}
+ \mC@merge{#2}{#3}{#4}
\setkeys{merge}{#1}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% REAKTIONSSCHEMA --------------------------------------------------------------------- %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newlength{\@rxn@node@distance}
-\setlength{\@rxn@node@distance}{1em}
-\providecommand{\setrcndist}[1]{
- \ifthenelse{\equal{#1}{}}{
- \setlength{\@rxn@node@distance}{1em}
- }{
- \setlength{\@rxn@node@distance}{#1}
- }
+\newlength{\mC@rxn@node@distance}
+\setlength{\mC@rxn@node@distance}{1em}
+\mC@def\setrcndist#1{%
+ \ifx\@empty#1\@empty%
+ \setlength{\mC@rxn@node@distance}{1em}%
+ \else%
+ \setlength{\mC@rxn@node@distance}{#1}%
+ \fi%
}
% ------------------------------------------------------------------------------------- %
% Schema ------------------------------------------------------------------------------ %
% ------------------------------------------------------------------------------------- %
-\newcommand{\@mc@rs@scale}{1.0} % Default-Skalierung
-\newcommand{\@mc@rs@currentscale}{\@mc@rs@scale} %
-\providecommand{\setschemename}[1]{\renewcommand{\@mc@rs@name}{#1}}
-\newcommand{\@mc@rs@caption}{} % Beschriftung
-\newcommand{\@mc@rs@label}{} % Label
-\newcommand{\@mc@rs@currentlabel}{\@mc@rs@label} %
+\newcommand{\mC@rs@scale}{1.0} % Default-Skalierung
+\newcommand{\mC@rs@currentscale}{\mC@rs@scale} %
+\providecommand{\setschemename}[1]{\renewcommand{\mC@rs@name}{#1}}
+\newcommand{\mC@rs@caption}{} % Beschriftung
+\newcommand{\mC@rs@label}{} % Label
+\newcommand{\mC@rs@currentlabel}{\mC@rs@label} %
\define@key{rxnscheme}{label}{% %
\ifthenelse{\equal{#1}{}}{}{ %
- \renewcommand{\@mc@rs@currentlabel}{#1} %
+ \renewcommand{\mC@rs@currentlabel}{#1} %
} %
} %
\define@key{rxnscheme}{scale}[1.0]{ % Skalierung
- \renewcommand{\@mc@rs@currentscale}{#1} %
+ \renewcommand{\mC@rs@currentscale}{#1} %
} %
\define@key{rxnscheme}{name}{ % Name
- \renewcommand{\@mc@rs@name}{#1} %
+ \renewcommand{\mC@rs@name}{#1} %
} %
\define@key{rxnscheme}{placement}{ % Float-Platzierung
- \renewcommand{\@mc@rs@currentplacement}{#1} %
+ \renewcommand{\mC@rs@currentplacement}{#1} %
} %
-\newcommand{\@mc@rs@align}{center} %
-\newcommand{\@mc@rs@right}{right} %
-\newcommand{\@mc@rs@center}{center} %
-\newcommand{\@mc@rs@left}{left} %
-\providecommand{\setschemealign}[1]{ %
- \ifthenelse{\equal{#1}{}}{ %
- \renewcommand{\@mc@rs@align}{center} %
- }{ %
- \renewcommand{\@mc@rs@align}{#1} %
- } %
+\newcommand{\mC@rs@align}{center} %
+\newcommand{\mC@rs@right}{right} %
+\newcommand{\mC@rs@center}{center} %
+\newcommand{\mC@rs@left}{left} %
+\mC@def\setschemealign#1{% %
+ \ifx\@empty#1\@empty %
+ \renewcommand{\mC@rs@align}{center} %
+ \else %
+ \renewcommand{\mC@rs@align}{#1} %
+ \fi %
} %
\define@key{rxnscheme}{align}{ % Alignment
- \renewcommand{\@mc@rs@align}{#1}
+ \renewcommand{\mC@rs@align}{#1}
}
-% Voreinstellungen:
-%\presetkeys%
-% {rxnscheme}
-% {scale=\@mc@rs@scale,align=\@mc@rs@align,label=\@mc@rs@label}
-% {}
% Gleitumgebung
\floatstyle{ruled}
-\newfloat{rxnfloat}{\@mc@rs@currentplacement}{rxnscheme}
-\floatname{rxnfloat}{\@mc@rs@name} % Name ändern
+\newfloat{rxnfloat}{\mC@rs@currentplacement}{rxnscheme}
+\floatname{rxnfloat}{\mC@rs@name} % Name ändern
% eigentliche Umgebung:
\newenvironment{rxnscheme}[2][]{%
\setkeys{rxnscheme}{#1}
- \renewcommand\@mc@rs@caption{#2}
+ \renewcommand\mC@rs@caption{#2}
\begin{rxnfloat}
%\centering
- \ifx\@mc@rs@align\@mc@rs@center \centering \fi
- \ifx\@mc@rs@align\@mc@rs@left \raggedright \fi
- \ifx\@mc@rs@align\@mc@rs@right \raggedleft \fi
- \@mc@atomsize\@mc@bondlength\@mc@bondshape
- \begin{tikzpicture}[every picture/.style={scale=\@mc@rs@currentscale},start chain,node distance=\@rxn@node@distance,inner sep=0pt]
+ \ifx\mC@rs@align\mC@rs@center \centering \fi
+ \ifx\mC@rs@align\mC@rs@left \raggedright \fi
+ \ifx\mC@rs@align\mC@rs@right \raggedleft \fi
+ \mC@atomsize\mC@bondlength\mC@bondshape
+ \begin{tikzpicture}[every picture/.style={scale=\mC@rs@currentscale},start chain,node distance=\mC@rxn@node@distance,inner sep=0pt,outer sep=0pt]
}{%
\end{tikzpicture}%
- \caption{\@mc@rs@caption}
- \ifthenelse{\equal{\@mc@rs@currentlabel}{}}{}{\label{\@mc@rs@currentlabel}}
+ \caption{\mC@rs@caption}
+ \ifthenelse{\equal{\mC@rs@currentlabel}{}}{}{\label{\mC@rs@currentlabel}}
\end{rxnfloat}
}
% ------------------------------------------------------------------------------------- %
% einfache Reaktion ------------------------------------------------------------------- %
% ------------------------------------------------------------------------------------- %
-\newcommand{\@mc@reaction@scale}{1.0}
-\newcommand{\@mc@reaction@align}{center}
-\providecommand{\setrxnalign}[1]{
- \ifthenelse{\equal{#1}{}}{
- \renewcommand{\@mc@reaction@align}{center}
- }{
- \renewcommand{\@mc@reaction@align}{#1}
- }
+\newcommand{\mC@reaction@scale}{1.0}
+\newcommand{\mC@reaction@align}{center}
+\mC@def\setrxnalign#1{
+ \ifx\@empty#1\@empty
+ \renewcommand{\mC@reaction@align}{center}
+ \else
+ \renewcommand{\mC@reaction@align}{#1}
+ \fi
}
-\newcommand{\@mc@reaction@right}{right}
-\newcommand{\@mc@reaction@center}{center}
-\newcommand{\@mc@reaction@left}{left}
+\newcommand{\mC@reaction@right}{right}
+\newcommand{\mC@reaction@center}{center}
+\newcommand{\mC@reaction@left}{left}
\define@key{rxn}{scale}{
- \renewcommand{\@mc@reaction@scale}{#1}}
+ \renewcommand{\mC@reaction@scale}{#1}}
\define@key{rxn}{align}{
- \renewcommand{\@mc@reaction@align}{#1}}
-% Voreinstellungen:
-%\presetkeys%
-% {rxn}
-% {scale=\@mc@reaction@scale,align=\@mc@reaction@align}
-% {}
+ \renewcommand{\mC@reaction@align}{#1}}
\newenvironment{rxn}[1][]{%
\setkeys{rxn}{#1}
- \ifx\@mc@reaction@align\@mc@reaction@center
+ \ifx\mC@reaction@align\mC@reaction@center
\begin{center}
\fi
- \ifx\@mc@reaction@align\@mc@reaction@left
+ \ifx\mC@reaction@align\mC@reaction@left
\begin{flushleft}
\fi
- \ifx\@mc@reaction@align\@mc@reaction@right
+ \ifx\mC@reaction@align\mC@reaction@right
\begin{flushright}
\fi
- \@mc@bondlength\@mc@bondshape\@mc@atomsize
- \begin{tikzpicture}[every picture/.style={scale=\@mc@reaction@scale},start chain,node distance=\@rxn@node@distance,inner sep=0pt]
+ \mC@bondlength\mC@bondshape\mC@atomsize
+ \begin{tikzpicture}[every picture/.style={scale=\mC@reaction@scale},start chain,node distance=\mC@rxn@node@distance,inner sep=0pt,outer sep=0pt]
}{%
\end{tikzpicture}%
- \ifx\@mc@reaction@align\@mc@reaction@center
+ \ifx\mC@reaction@align\mC@reaction@center
\end{center}
\fi
- \ifx\@mc@reaction@align\@mc@reaction@left
+ \ifx\mC@reaction@align\mC@reaction@left
\end{flushleft}
\fi
- \ifx\@mc@reaction@align\@mc@reaction@right
+ \ifx\mC@reaction@align\mC@reaction@right
\end{flushright}
\fi
}
@@ -705,26 +748,50 @@
% REAKTANDEN -------------------------------------------------------------------------- %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Standardreaktand -------------------------------------------------------------------- %
-\newcommand{\@mc@reactand}[3][]{\draw node[on chain=going #1](#3) {#2};}
-\providecommand{\reactand}[3][right]{\@mc@reactand[#1]{#2}{#3}}
+\mC@def\mC@reactand{\@ifnextchar[{\mC@reactand@ii}{\mC@reactand@i}}
+\mC@def\mC@reactand@i#1{\def\mC@firstarg{on chain=going right}\let\mC@secondarg\@empty\let\mC@thirdarg\@empty\mC@reactand@iii{#1}}
+\mC@def\mC@reactand@ii[#1]#2{
+ \let\mC@remainargs\@empty\mC@splitarg{#1}
+ \ifx\mC@firstarg\@empty\def\mC@reactand@alignment{right}\else\let\mC@reactand@alignment\mC@firstarg\fi
+ \def\mC@firstarg{on chain=going \mC@reactand@alignment}
+ \mC@reactand@iii{#2}}
+\mC@def\mC@reactand@iii#1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg](\mC@secondarg){#1};}
+\mC@def\reactand{\mC@reactand}
% Mesomerie --------------------------------------------------------------------------- %
-\newcommand{\@mc@mesomeric}[3][]{\draw node[inner sep=1pt,on chain=going #1,left delimiter={[},right delimiter={]}](#3) {#2};}
-\providecommand{\mesomeric}[3][right]{\@mc@mesomeric[#1]{\begin{tikzpicture}[start branch]#2\end{tikzpicture}}{#3}}
+\mC@def\mC@mesomeric{\@ifnextchar[{\mC@mesomeric@ii}{\mC@mesomeric@i}}
+\mC@def\mC@mesomeric@i#1{\def\mC@firstarg{on chain=going right}\let\mC@secondarg\@empty\let\mC@thirdarg\@empty\mC@mesomeric@iii{#1}}
+\mC@def\mC@mesomeric@ii[#1]#2{
+ \let\mC@remainargs\@empty\mC@splitarg{#1}
+ \ifx\mC@firstarg\@empty\def\mC@mesomeric@alignment{right}\else\let\mC@mesomeric@alignment\mC@firstarg\fi
+ \def\mC@firstarg{on chain=going \mC@mesomeric@alignment}
+ \mC@mesomeric@iii{#2}}
+\mC@def\mC@mesomeric@iii#1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg,inner sep=1pt,left delimiter={[},right delimiter={]}](\mC@secondarg){\tikzpicture[start branch]#1\endtikzpicture};}
+\mC@def\mesomeric{\mC@mesomeric}
+
\providecommand{\marrow}[1][right]{\arrow[type=<->,length=.5,direction=#1]{}{}}
-\providecommand{\dummy}[1][]{\draw node[on chain,xshift=-\@rxn@node@distance](#1) {};}
+% Dummy ------------------------------------------------------------------------------- %
+\providecommand{\dummy}[1][]{\draw node[on chain,xshift=-\mC@rxn@node@distance](#1) {};}
% Uebergangszustand ------------------------------------------------------------------- %
-\newcommand\@mc@transition@name{}
-\newcommand{\@mc@transition}[3][]{
- \ifthenelse{\equal{#3}{}}{\renewcommand\@mc@transition@name{a}}{\renewcommand\@mc@transition@name{#3}}
- \draw node[inner sep=1pt,on chain=going #1,left delimiter={[},right delimiter={]}](\@mc@transition@name) {#2} node at ($(\@mc@transition@name.north east)+(.25,0)$) {$\ddagger$};
-}
-\providecommand{\transition}[3][right]{\@mc@transition[#1]{\begin{tikzpicture}[start branch]#2\end{tikzpicture}}{#3}}
+\mC@def\mC@transition@name{x}
+\mC@def\mC@transition{\@ifnextchar[{\mC@transition@ii}{\mC@transition@i}}
+\mC@def\mC@transition@i#1{\def\mC@firstarg{on chain=going right}\let\mC@secondarg\mC@transition@name\let\mC@thirdarg\@empty\mC@transition@iii{#1}}
+\mC@def\mC@transition@ii[#1]#2{
+ \let\mC@remainargs\@empty\mC@splitarg{#1}
+ \ifx\mC@firstarg\@empty\def\mC@transition@alignment{right}\else\let\mC@transition@alignment\mC@firstarg\fi
+ \def\mC@firstarg{on chain=going \mC@transition@alignment}
+ \ifx\mC@secondarg\@empty\let\mC@secondarg\mC@transition@name\fi
+ \mC@transition@iii{#2}}
+\mC@def\mC@transition@iii#1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg,inner sep=1pt,left delimiter={[},right delimiter={]}](\mC@secondarg){#1} node at ($(\mC@secondarg.north east)+(.25,0)$) {$\ddagger$};}
+\mC@def\transition{\mC@transition}
% Abzweigung -------------------------------------------------------------------------- %
-\newcommand{\@mc@branch}[3][]{\node[#1] (#3) {#2};}
-\providecommand{\branch}[3][on chain=going right]{\@mc@branch[#1]{\begin{tikzpicture}[start branch]#2\end{tikzpicture}}{#3}}
+\mC@def\mC@branch{\@ifnextchar[{\mC@branch@ii}{\mC@branch@i}}
+\mC@def\mC@branch@i#1{\def\mC@firstarg{on chain=going right}\let\mC@secondarg\@empty\let\mC@thirdarg\@empty\mC@branch@iii{#1}}
+\mC@def\mC@branch@ii[#1]#2{\let\mC@remainargs\@empty\mC@splitarg{#1}\ifx\mC@firstarg\@empty\def\mC@firstarg{on chain=going right}\fi\mC@branch@iii{#2}}
+\mC@def\mC@branch@iii#1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg](\mC@secondarg){\tikzpicture[start branch]#1\endtikzpicture};}
+\mC@def\branch{\mC@branch}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sonstiges --------------------------------------------------------------------------- %
@@ -732,99 +799,140 @@
% Elektronenverschiebungspfeile ------------------------------------------------------- %
\providecommand{\elmove}[5][->,red,shorten <=3pt,shorten >=1pt]{\chemmove{\draw[#1](#2).. controls +(#3) and +(#5)..(#4);}}
% Bindungslänge ----------------------------------------------------------------------- %
-\newcommand{\@mc@bondlength}{\setatomsep{1.8em}}
-\providecommand{\bondlength}[1]{
- \ifthenelse{\equal{#1}{}}{
- \renewcommand{\@mc@bondlength}{\setatomsep{1.8em}}
- }{
- \renewcommand{\@mc@bondlength}{\setatomsep{#1}}
- }
-}
+\newcommand{\mC@bondlength}{\setatomsep{1.8em}}
+\mC@def\setbondlength#1{
+ \ifx\@empty#1\@empty
+ \renewcommand{\mC@bondlength}{\setatomsep{1.8em}}
+ \else
+ \renewcommand{\mC@bondlength}{\setatomsep{#1}}
+ \fi
+}
+\let\bondlength\setbondlength
% Keilbindungen ----------------------------------------------------------------------- %
-\newcommand{\@mc@bondshape@one}{3pt}
-\newcommand{\@mc@bondshape@two}{.5pt}
-\newcommand{\@mc@bondshape@three}{1pt}
-\providecommand{\bondshape}[3]{
- \ifthenelse{\equal{#1}{}}{
- \renewcommand{\@mc@bondshape@one}{3pt}
- }{
- \renewcommand{\@mc@bondshape@one}{#1}
- }
- \ifthenelse{\equal{#2}{}}{
- \renewcommand{\@mc@bondshape@two}{.5pt}
- }{
- \renewcommand{\@mc@bondshape@two}{#2}
- }
- \ifthenelse{\equal{#3}{}}{
- \renewcommand{\@mc@bondshape@three}{1pt}
- }{
- \renewcommand{\@mc@bondshape@three}{#3}
- }
-}
-\newcommand{\@mc@bondshape}{\setcrambond{\@mc@bondshape@one}{\@mc@bondshape@two}{\@mc@bondshape@three}}
+\mC@def\mC@bondshape@one{3pt}
+\mC@def\mC@bondshape@two{.5pt}
+\mC@def\mC@bondshape@three{1pt}
+\mC@def\setbondshape#1#2#3{
+ \ifx\@empty#1\@empty
+ \renewcommand{\mC@bondshape@one}{3pt}
+ \else
+ \renewcommand{\mC@bondshape@one}{#1}
+ \fi
+ \ifx\@empty#2\@empty
+ \renewcommand{\mC@bondshape@two}{.5pt}
+ \else
+ \renewcommand{\mC@bondshape@two}{#2}
+ \fi
+ \ifx\@empty#3\@empty
+ \renewcommand{\mC@bondshape@three}{1pt}
+ \else
+ \renewcommand{\mC@bondshape@three}{#3}
+ \fi
+}
+\let\bondshape\setbondshape
+\mC@def\mC@bondshape{\setcrambond{\mC@bondshape@one}{\mC@bondshape@two}{\mC@bondshape@three}}
% Atomgröße --------------------------------------------------------------------------- %
-\newcommand{\@mc@atomsize}{\small}
-\providecommand{\atomsize}[1]{
- \ifthenelse{\equal{#1}{}}{
- \renewcommand{\@mc@atomsize}{\small}
- }{
- \renewcommand{\@mc@atomsize}{#1}
- }
-}
+\mC@def\mC@atomsize{\small}
+\mC@def\setatomsize#1{
+ \ifx\@empty#1\@empty
+ \renewcommand{\mC@atomsize}{\small}
+ \else
+ \renewcommand{\mC@atomsize}{#1}
+ \fi
+}
+\let\atomsize\setatomsize
+% Plus -------------------------------------------------------------------------------- %
+\mC@def\mC@chemand{\@ifnextchar[{\mC@chemand@ii}{\mC@chemand@i}}
+\mC@def\mC@chemand@i{\def\mC@firstarg{on chain=going right}\let\mC@secondarg\@empty\let\mC@thirdarg\@empty\mC@chemand@iii}
+\mC@def\mC@chemand@ii[#1]{
+ \let\mC@remainargs\@empty\mC@splitarg{#1}
+ \ifx\mC@firstarg\@empty\def\mC@chemand@alignment{right}\else\let\mC@chemand@alignment\mC@firstarg\fi
+ \def\mC@firstarg{on chain=going \mC@chemand@alignment}
+ \mC@chemand@iii}
+\mC@def\mC@chemand@iii{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg](\mC@secondarg){\chemsign[0pt]{+}};}
+\mC@def\chemand{\mC@chemand}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Setup myChemistry ------------------------------------------------------------------- %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mC@def\mCsetup#1{\setkeys{setup}{#1}}
+\define@key{setup}{arrowlength}[5em]{%
+ \setarrowlength{#1}}
+\define@key{setup}{atomsize}[\small]{%
+ \setatomsize{#1}}
+\define@key{setup}{bondlength}[1.8em]{%
+ \setbondlength{#1}}
+\define@key{setup}{rcndist}[1em]{%
+ \setrcndist{#1}}
+\define@key{setup}{rxnalign}[center]{%
+ \setrxnalign{#1}}
+\define@key{setup}{schemealign}[center]{%
+ \setschemealign{#1}}
+\define@key{setup}{align}[center]{%
+ \setrxnalign{#1}
+ \setschemealign{#1}}
+\define@key{setup}{reset}[]{%
+ \setarrowlength{}
+ \setatomsize{}
+ \setbondlength{}
+ \setbondshape{}{}{}
+ \setrcndist{}
+ \setrxnalign{}
+ \setschemealign{}}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% NODES SICHTBAR/UNSICHTBAR MACHEN ---------------------------------------------------- %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\makevisible{
- \renewcommand{\@mc@branch}[3][]{\node[draw=purple,dotted,##1] (##3) {##2};}
- \renewcommand{\@mc@reactand}[3][]{\draw node[draw=red!60,solid,on chain=going ##1](##3) {##2};}
- \renewcommand{\@mc@mesomeric}[3][]{\draw node[draw=red!60,solid,on chain=going ##1,left delimiter={[},right delimiter={]}](##3) {##2};}
- \renewcommand{\@arrow}[3][]{
- \renewcommand{\@arrow@length@factor}{\@arrow@currentlength}
- \setlength{\@arrow@length@actual}{\@arrow@currentlength\@arrow@length@default}
- \ifthenelse{\equal{\@arrow@argument@both}{true}}{
- \@mc@largernode{##2}{##3}
+ \def\mC@reactand@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg,draw=red!60,solid](\mC@secondarg){##1};}
+ \def\mC@branch@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg,draw=purple,dotted](\mC@secondarg){\tikzpicture[start branch]##1\endtikzpicture};}
+ \def\mC@transition@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg,inner sep=1pt,left delimiter={[},right delimiter={]},draw=red!60,solid](\mC@secondarg){##1} node at ($(\mC@secondarg.north east)+(.25,0)$) {$\ddagger$};}
+ \renewcommand{\mC@arrow}[3][]{
+ \renewcommand{\mC@arrow@length@factor}{\mC@arrow@currentlength}
+ \setlength{\mC@arrow@length@actual}{\mC@arrow@currentlength\mC@arrow@length@default}
+ \ifthenelse{\equal{\mC@arrow@argument@both}{true}}{
+ \mC@largernode{##2}{##3}
}{
- \setlength{\@arrow@argument@width}{0pt}
- \setlength{\@arrow@argument@height}{0pt}
+ \setlength{\mC@arrow@argument@width}{0pt}
+ \setlength{\mC@arrow@argument@height}{0pt}
}
- \draw node[solid,on chain=going \@arrow@currentdirection](\@arrow@currentname) {\tikz{
- \@arrow@drawing
+ \draw node[solid,on chain=going \mC@arrow@currentdirection](\mC@arrow@currentname) {\tikz{
+ \mC@arrow@drawing
}
};
- \@arrow@argument@anchor
- \draw node[draw=green!60,solid,anchor=\@arrow@above@anchor,rotate=\@arrow@rotate,minimum width=\@arrow@argument@width, minimum height=\@arrow@argument@height]
- at ($(@arrow@center.base)+(90+\@arrow@argument@angle:\@arrow@argument@aboveshift)$) {##2};
- \draw node[draw=blue!60,solid,anchor=\@arrow@below@anchor,rotate=\@arrow@rotate,minimum width=\@arrow@argument@width, minimum height=\@arrow@argument@height]
- at ($(@arrow@center.base)+(-90+\@arrow@argument@angle:\@arrow@argument@belowshift)$) {##3};
- \setlength{\@arrow@argument@aboveshift}{2pt}
- \setlength{\@arrow@argument@belowshift}{2pt}
+ \mC@arrow@argument@anchor
+ \draw node[draw=green!60,solid,anchor=\mC@arrow@above@anchor,rotate=\mC@arrow@rotate,minimum width=\mC@arrow@argument@width, minimum height=\mC@arrow@argument@height]
+ at ($(@arrow@center.base)+(90+\mC@arrow@argument@angle:\mC@arrow@argument@aboveshift)$) {##2};
+ \draw node[draw=blue!60,solid,anchor=\mC@arrow@below@anchor,rotate=\mC@arrow@rotate,minimum width=\mC@arrow@argument@width, minimum height=\mC@arrow@argument@height]
+ at ($(@arrow@center.base)+(-90+\mC@arrow@argument@angle:\mC@arrow@argument@belowshift)$) {##3};
+ \setlength{\mC@arrow@argument@aboveshift}{2pt}
+ \setlength{\mC@arrow@argument@belowshift}{2pt}
}
}
\newcommand\makeinvisible{
- \renewcommand{\@mc@reactand}[3][]{\draw node[on chain=going ##1](##3) {##2};}
- \renewcommand{\@mc@mesomeric}[3][]{\draw node[on chain=going ##1,left delimiter={[},right delimiter={]}](##3) {##2};}
- \renewcommand{\@mc@branch}[3][]{\node[##1] (##3) {##2};}
- \renewcommand{\@arrow}[3][]{
- \renewcommand{\@arrow@length@factor}{\@arrow@currentlength}
- \setlength{\@arrow@length@actual}{\@arrow@currentlength\@arrow@length@default}
- \ifthenelse{\equal{\@arrow@argument@both}{true}}{
- \@mc@largernode{##2}{##3}
+ \def\mC@reactand@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg](\mC@secondarg){##1};}
+ \def\mC@branch@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg](\mC@secondarg){\tikzpicture[start branch]##1\endtikzpicture};}
+ \def\mC@transition@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg,inner sep=1pt,left delimiter={[},right delimiter={]}](\mC@secondarg){##1} node at ($(\mC@secondarg.north east)+(.25,0)$) {$\ddagger$};}
+ \renewcommand{\mC@arrow}[3][]{
+ \renewcommand{\mC@arrow@length@factor}{\mC@arrow@currentlength}
+ \setlength{\mC@arrow@length@actual}{\mC@arrow@currentlength\mC@arrow@length@default}
+ \ifthenelse{\equal{\mC@arrow@argument@both}{true}}{
+ \mC@largernode{##2}{##3}
}{
- \setlength{\@arrow@argument@width}{0pt}
- \setlength{\@arrow@argument@height}{0pt}
+ \setlength{\mC@arrow@argument@width}{0pt}
+ \setlength{\mC@arrow@argument@height}{0pt}
}
- \draw node[on chain=going \@arrow@currentdirection](\@arrow@currentname) {\tikz{
- \@arrow@drawing
+ \draw node[on chain=going \mC@arrow@currentdirection](\mC@arrow@currentname) {\tikz{
+ \mC@arrow@drawing
}
};
- \@arrow@argument@anchor
- \draw node[anchor=\@arrow@above@anchor,rotate=\@arrow@rotate,minimum width=\@arrow@argument@width, minimum height=\@arrow@argument@height]
- at ($(@arrow@center.base)+(90+\@arrow@argument@angle:\@arrow@argument@aboveshift)$) {##2};
- \draw node[anchor=\@arrow@below@anchor,rotate=\@arrow@rotate,minimum width=\@arrow@argument@width, minimum height=\@arrow@argument@height]
- at ($(@arrow@center.base)+(-90+\@arrow@argument@angle:\@arrow@argument@belowshift)$) {##3};
- \setlength{\@arrow@argument@aboveshift}{2pt}
- \setlength{\@arrow@argument@belowshift}{2pt}
+ \mC@arrow@argument@anchor
+ \draw node[anchor=\mC@arrow@above@anchor,rotate=\mC@arrow@rotate,minimum width=\mC@arrow@argument@width, minimum height=\mC@arrow@argument@height]
+ at ($(@arrow@center.base)+(90+\mC@arrow@argument@angle:\mC@arrow@argument@aboveshift)$) {##2};
+ \draw node[anchor=\mC@arrow@below@anchor,rotate=\mC@arrow@rotate,minimum width=\mC@arrow@argument@width, minimum height=\mC@arrow@argument@height]
+ at ($(@arrow@center.base)+(-90+\mC@arrow@argument@angle:\mC@arrow@argument@belowshift)$) {##3};
+ \setlength{\mC@arrow@argument@aboveshift}{2pt}
+ \setlength{\mC@arrow@argument@belowshift}{2pt}
}
}
% ------------------------------------------------------------------------------------- %