diff options
author | Karl Berry <karl@freefriends.org> | 2011-04-23 22:39:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-04-23 22:39:48 +0000 |
commit | 59c2fb860cfc7f447fded1f644421e4ee9bff956 (patch) | |
tree | 94338038fd674d5653722e937d0b76c1183bea61 /Master/texmf-dist/tex/latex | |
parent | e3cf4b9e3f515cb071141c031fb4c688ee2c9ce4 (diff) |
mychemistry 1.5 (23apr11)
git-svn-id: svn://tug.org/texlive/trunk@22176 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty | 1147 |
1 files changed, 560 insertions, 587 deletions
diff --git a/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty b/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty index cf4ed6a2118..60a6b968d60 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/04/15 ------------------------------------------------------------------------ % +% - 2011/04/23 ------------------------------------------------------------------------ % % ------------------------------------------------------------------------------------- % % - http://www.niederberger-berlin.net/2011/02/latex-mychemistry/ --------------------- % % - kontakt@niederberger-berlin.net --------------------------------------------------- % @@ -92,38 +92,53 @@ % - own arrow tips defined - % % - command \setarrowline added - % % - new arrow type -+> added - % +% - 2011/04/23 version 1.5 - % +% - major parts of the code rewritten -- - % +% - the whole positioning part now is different and way more flexible: - % +% - arbitrary angles can be used for positioning, referencing an object is - % +% - easier, arrows can be modified using <tikz>, command \anywhere now has - % +% - similar syntax - % +% - arrow types <=>> and <<=> added - % +% - arrow type -+> modified: more flexible - % +% - bugfixes in error-handling - % % ------------------------------------------------------------------------------------- % -% - TODO - % +% - TODO: - % % - work on how chemistry-packages are automatically loaded; - % % - add ui for easy handling this issue? (via \mCsetup ?) - % -% - add rotate=<winkel> for diagonal arrows? - % -% - option for baseline-alignment of reactants et.al.? - % -% - option for shifting arrows? - % -% - Hook, damit die Befehle erkennen, ob sie innerhalb Umgebung sind? - % -% - Pfeil-Typen: <<=>/<=>> hinzufügen - % +% - add arrow types <=+>, <+=>, <=+>>, <+=>>, <<=+>, <<+=> ? - % % ------------------------------------------------------------------------------------- % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\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{1.4} -\mC@def\mC@date@de{15. April 2011} -\mC@def\mC@date@en{April 15th 2011} -\mC@def\mC@date{2011/04/15} -\mC@def\mC@name{myChemistry} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Paket Info % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\mC@version{1.5} +\def\mC@date@de{23. April 2011} +\def\mC@date@en{April 23rd 2011} +\def\mC@date{2011/04/23} +\def\mC@name{myChemistry} \ProvidesPackage{mychemistry}[\mC@date\space v\mC@version] \typeout{} \typeout{\mC@name\space v\mC@version} \typeout{\mC@date\space Clemens Niederberger} \typeout{} \RequirePackage{ifthen,calc,float,xkeyval} +% myChemistry Informationen ----------------------------------------------------------- % +\def\mCversion{\mC@version} +\def\mCdate#1{\csname mC@date@#1\endcsname} +% additional für ChemFig v0.4 --------------------------------------------------------- % +\def\mC@CFversion@test{0.4}% +\IfFileExists{bondwidth.tex}{% + \ifx\CF@ver\mC@CFversion@test\input{bondwidth}\fi +}{}% +\def\mC@CFversion@test{0.4a} +\IfFileExists{bondwidth.tex}{% + \ifx\CF@ver\mC@CFversion@test\input{bondwidth}\fi +}{}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Optionen, z.T. auch an chemexec weitergeben -\mC@def\mC@exec@color{black} -\mC@def\mC@exec@shade{false} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\mC@exec@color{black} +\def\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}% @@ -143,22 +158,22 @@ \def\mC@exec@shade{true} } % chemexec abschalten -\mC@def\mC@exec@true{true} +\def\mC@exec@true{true} \DeclareOptionX[MC]{nochemexec}{% \def\mC@exec@true{false} } % mhchem abschalten -\mC@def\mC@mhchem@true{true} +\def\mC@mhchem@true{true} \DeclareOptionX[MC]{nomhchem}{% \def\mC@mhchem@true{false} } % chemcompounds abschalten -\mC@def\mC@compound@true{true} +\def\mC@compound@true{true} \DeclareOptionX[MC]{nocompounds}{% \def\mC@compound@true{false} } % chemstyle einschalten -\mC@def\mC@chemstyle@true{false} +\def\mC@chemstyle@true{false} \DeclareOptionX[MC]{chemstyle}{% \def\mC@chemstyle@true{true} } @@ -170,14 +185,14 @@ \def\mC@chemstyle@true{false} } % englische Version von chemexec, englische Variante von myChemistry -\mC@def\mC@exec@english{} -\mC@def\mC@rs@name{Reaktionsschema} +\def\mC@exec@english{} +\def\mC@rs@name{Reaktionsschema} \DeclareOptionX[MC]{english}{ \def\mC@exec@english{,english} \def\mC@rs@name{Reaction scheme} } -\mC@def\mC@rs@placement{H} -\mC@def\mC@rs@currentplacement{\mC@rs@placement} +\def\mC@rs@placement{hpt} +\def\mC@rs@currentplacement{\mC@rs@placement} \define@key[MC]{mychemistry.sty}{placement}{ \def\mC@rs@placement{#1} } @@ -211,7 +226,7 @@ } \usetikzlibrary{arrows,positioning,decorations.pathmorphing,shapes,calc,matrix,chains,scopes} }{% sonst Fehlermeldung - \PackageError{mychemistry}{`ChemFig' is not installed! `myChemistry' can't work without it!} + \PackageError{mychemistry}{The ChemFig package is not installed! myChemistry can't work without it}{See the myChemistry package documentation for explanation} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % chemexec laden, falls verfügbar, falls nicht, dann wenigstens mhchem laden @@ -238,271 +253,332 @@ } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% NEUE BEFEHLE: % +% Tools ------------------------------------------------------------------------------- % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% 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 -}{}% -\def\mC@CFversion@test{0.4} -\IfFileExists{bondwidth.tex}{% - \ifx\CF@ver\mC@CFversion@test\input{bondwidth}\fi -}{}% +\def\mC@true{true} +\def\mC@false{false} % Optional Argument Analysis ---------------------------------------------------------- % % Prüfen ob #2 in #1 enthalten ist -\mC@def\mC@if@instr#1#2{% +\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\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{ +\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 } +% Direction Analysis ------------------------------------------------------------------ % +% Richtungen: +\def\mC@r{right} +\def\mC@ar{above right} +\def\mC@a{above} +\def\mC@al{above left} +\def\mC@l{left} +\def\mC@br{below right} +\def\mC@b{below} +\def\mC@bl{below left} +\def\mC@vert@i{90} +\def\mC@vert@ii{-90} +\def\mC@vert@iii{270} +% Richtung in Bezug auf node oder nicht? +\def\mC@split@angle#1.#2\@nil#3{\def#3{#1}\def\mC@direction{#2}} +\def\mC@wowo@node#1{\mC@if@instr{#1}{.}{\expandafter\mC@split@angle#1\@nil\mC@referred@node}{\def\mC@direction{#1}}} +% Winkel bestimmen: +\def\mC@analyze@angle#1{ + \let\mC@angle\@empty + \let\mC@referred@node\@empty + \mC@wowo@node{#1} + \ifx\mC@direction\mC@r\def\mC@angle{0}\fi + \ifx\mC@direction\mC@ar\def\mC@angle{45}\fi + \ifx\mC@direction\mC@a\def\mC@angle{90}\fi + \ifx\mC@direction\mC@al\def\mC@angle{135}\fi + \ifx\mC@direction\mC@l\def\mC@angle{180}\fi + \ifx\mC@direction\mC@bl\def\mC@angle{225}\fi + \ifx\mC@direction\mC@b\def\mC@angle{270}\fi + \ifx\mC@direction\mC@br\def\mC@angle{315}\fi + \ifx\mC@angle\@empty\pgfmathparse{\mC@direction <0 ? int(\mC@direction+360) : int(\mC@direction) }\edef\mC@angle{\pgfmathresult}\fi +} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % PFEILE ------------------------------------------------------------------------------ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% interne Befehle, Voreinstellungen --------------------------------------------------- % -\mC@def\mC@arrow@above{above} % oben -\mC@def\mC@arrow@currentabove{\mC@arrow@above} % -\mC@def\mC@arrow@below{below} % unten -\mC@def\mC@arrow@currentbelow{\mC@arrow@below} % -\mC@def\mC@arrow@direction{right} % Richtung -\mC@def\mC@arrow@currentdirection{\mC@arrow@direction} -\mC@def\mC@arrow@currentlength{\mC@arrow@length} -\newlength{\mC@arrow@length@actual} -\mC@def\mC@arrow@rotate{} -\mC@def\mC@arrow@argument@angle{} -\mC@def\mC@arrow@argument@shift{2pt} -\mC@def\mC@arrow@argument@anchor{} -\mC@def\mC@arrow@argument@both{} -\mC@def\mC@arrow@above@anchor{} -\mC@def\mC@arrow@below@anchor{} -\mC@def\mC@arrow@type{->} % Pfeiltyp -\mC@def\mC@arrow@currenttype{\mC@arrow@type} % -\mC@def\mC@arrow@start@up{0,0.05} % Verschiebung für Glgw-Pfeil -\mC@def\mC@arrow@start@down{0,-0.05} % -\mC@def\mC@arrow@placement{on chain=going \mC@arrow@currentdirection} % wohin? -\mC@def\mC@arrow@currentplacement{\mC@arrow@placement} -\mC@def\mC@arrow@cross@base@x{} % Befehle für durchgestrichenen Pfeil -\mC@def\mC@arrow@cross@base@y{} % -\mC@def\mC@arrow@cross@angle{} % -\mC@def\mC@arrow@cross@length{} % -\mC@def\mC@arrow@cross@draw{} % +% \arrow[<pos>,<type>,<length factor>,<name>,both,<tikz>]{<above>}{<below>} +% Pfeiltypen: +\def\mC@arrow@type@def{->} +\def\mC@arrow@type@eqv{<->} +\def\mC@arrow@type@back{<-} +\def\mC@arrow@type@eq{<=>} +\def\mC@arrow@type@eqq{<=>>} +\def\mC@arrow@type@eeq{<<=>} +\def\mC@arrow@type@not{-|>} +\def\mC@arrow@type@pm{-+>} -% Laengenfaktor ----------------------------------------------------------------------- % -\mC@def\mC@arrow@length{1.0} % Längenfaktor -\mC@def\mC@arrow@length@factor{1.0} % Default-Faktor -\mC@def\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} % -\newlength{\mC@arrow@length@value} % -\setlength{\mC@arrow@length@value}{\mC@arrow@length@default} % Default-Laenge -\mC@def\setarrowlength#1{ - \ifx\@empty#1\@empty - \setlength{\mC@arrow@length@value}{\mC@arrow@length@default} - \else - \setlength{\mC@arrow@length@value}{#1} - \fi -} -% \let\arrowlength\setarrowlength - -% Beschriftungen ---------------------------------------------------------------------- % -\newlength{\mC@arrow@argument@aboveshift} % Verschieben der Beschriftung -\newlength{\mC@arrow@argument@belowshift} % Verschieben der Beschriftung -\define@key{arrow}{aboveshift}[2pt]{% - \setlength{\mC@arrow@argument@aboveshift}{#1}} -\define@key{arrow}{belowshift}[2pt]{% - \setlength{\mC@arrow@argument@belowshift}{#1}} -\define@key{arrow}{both}[]{ - \renewcommand{\mC@arrow@argument@both}{true} +% Voreinstellungen -------------------------------------------------------------------- % +% Pfeillänge -------------------------------------------------------------------------- % +% \newlength{\mC@arrow@length} +\def\mC@arrow@length@def{4em} +\let\mC@arrow@length\mC@arrow@length@def +\def\mC@arrow@factor{1} +\def\setarrowlength#1{% + \ifx\@empty#1\@empty% + \let\mC@arrow@length\mC@arrow@length@def% + \else% + \def\mC@arrow@length{#1}% + \fi% } - -% Anker ------------------------------------------------------------------------------- % -\mC@def\mC@arrow@name{} % Anker -\mC@def\mC@arrow@currentname{\mC@arrow@name} % -\define@key{arrow}{name}[\mC@arrow@name]{% % - \renewcommand{\mC@arrow@currentname}{#1}}% % - -% Richtung ---------------------------------------------------------------------------- % -\define@key{arrow}{direction}[\mC@arrow@direction]{% - \renewcommand{\mC@arrow@currentdirection}{#1} % - \ifthenelse{\equal{#1}{right}}{% nach rechts, Einstellungen: - \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{\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{\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{\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{\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{\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{\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{\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{\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{\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{\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{\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{\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{\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{\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{\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 - } - } - } - } - } - } - } - } +% Label-Abstand ----------------------------------------------------------------------- % +\def\mC@arrow@label@dist@def{.2em} +\def\mC@arrow@label@dist{\mC@arrow@label@dist@def} +\def\setarrowlabel#1{% + \ifx\@empty#1\@empty% + \def\mC@arrow@label@dist{\mC@arrow@label@dist@def}% + \else% + \def\mC@arrow@label@dist{#1}% + \fi% } - % Pfeildicke -------------------------------------------------------------------------- % -\mC@def\mC@arrow@linethickness@default{semithick} -\mC@def\mC@arrow@linethickness{\mC@arrow@linethickness@default} -\mC@def\setarrowline#1{% +\def\mC@arrow@linethickness@default{semithick} +\def\mC@arrow@linethickness{\mC@arrow@linethickness@default} +\def\setarrowline#1{% \ifx\@empty#1\@empty% \def\mC@arrow@linethickness{\mC@arrow@linethickness@default}% \else% \def\mC@arrow@linethickness{#1}% \fi% } +% ------------------------------------------------------------------------------------- % +% Winkel untersuchen, um Label richtig anzubringen ------------------------------------ % +\def\mC@evaluate@angle#1{ +\newcount\mC@alpha +\mC@alpha=#1 +\pgfmathparse{cos(\mC@alpha) > 0} +\ifnum\pgfmathresult=1 + \def\mC@beta{#1} + \def\mC@arrow@label@anchor@up{south} + \def\mC@arrow@label@anchor@down{north} + \ifnum\mC@alpha<180 + \def\mC@arrow@label@anchor@add{east} + \def\mC@arrow@label@anchor@sub{south} + \else + \def\mC@arrow@label@anchor@add{south} + \def\mC@arrow@label@anchor@sub{west} + \fi +\else + \pgfmathparse{cos(\mC@alpha) == 0} + \ifnum\pgfmathresult=1 + \def\mC@beta{0} + \ifnum\mC@alpha=90 + \def\mC@arrow@label@anchor@up{east} + \def\mC@arrow@label@anchor@down{west} + \def\mC@arrow@label@anchor@add{east} + \def\mC@arrow@label@anchor@sub{east} + \else + \def\mC@arrow@label@anchor@up{west} + \def\mC@arrow@label@anchor@down{east} + \def\mC@arrow@label@anchor@add{west} + \def\mC@arrow@label@anchor@sub{west} + \fi + \else + \def\mC@arrow@label@anchor@up{north} + \def\mC@arrow@label@anchor@down{south} + \ifnum\mC@alpha=180 + \def\mC@beta{180-#1} + \def\mC@arrow@label@anchor@add{north} + \def\mC@arrow@label@anchor@sub{north} + \fi + \ifnum\mC@alpha>180 + \def\mC@beta{180+#1} + \def\mC@arrow@label@anchor@add{west} + \def\mC@arrow@label@anchor@sub{north} + \fi + \ifnum\mC@alpha<180 + \def\mC@beta{180+#1} + \def\mC@arrow@label@anchor@add{north} + \def\mC@arrow@label@anchor@sub{east} + \fi + \fi +\fi +} +% ------------------------------------------------------------------------------------- % +% Maße der Nodes der Pfeilargumente bestimmen, größere später an Pfeil weitergeben +\def\mC@arrow@both{both} +\newlength{\mC@height@A} +\newlength{\mC@height@B} +\newlength{\mC@arrow@label@height} +\newlength{\mC@width@A} +\newlength{\mC@width@B} +\newlength{\mC@arrow@label@width} +\def\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! +\def\mC@largernode#1#2{ + \@ifundefined{pgfpositionnodelater}{ + \PackageError{mychemistry}{The command \string\pgfpositionnodelater\space is undefined. Make sure, you have installed the latest version of pgf}{See the myChemistry package documentation for explanation} + }{} + {\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} + \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{\mC@arrow@label@width}{max(\mC@width@A,\mC@width@B)} + \pgfmathsetlength{\mC@arrow@label@height}{max(\mC@height@A,\mC@height@B)} + \global\mC@arrow@label@width=\mC@arrow@label@width + \global\mC@arrow@label@height=\mC@arrow@label@height + } +} +% ------------------------------------------------------------------------------------- % +% Pfeil zeichnen: +\def\arrow{\@ifnextchar[{\mC@arrow@ii}{\mC@arrow@i}} +\def\mC@arrow@i#1#2{ + \node[on chain=going {at=(\tikzchainprevious.0)},minimum size=0,inner sep=3pt,outer sep=0,anchor=180,shift=(0:.5*\mC@rxn@node@distance)] (@mC@arrow@start){}; + \node[on chain=going {at=(\tikzchainprevious.0),shift=($(0:.5*\mC@arrow@factor*\mC@arrow@length)$)}, minimum size=0,inner sep=3pt,outer sep=0] (@mC@arrow@end){}; + \draw[-mCtip,\mC@arrow@linethickness] let \n1={0}, \n2={180} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](mC@arrow@center){} ++($(0:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=0,anchor=south,inner sep=0] at ($(mC@arrow@center)!\mC@arrow@label@dist!90:(@mC@arrow@end)$){#1}; + \expandafter\node\expandafter[\mC@arrow@downlabel@visible,rotate=0,anchor=north,inner sep=0] at ($(mC@arrow@center)!\mC@arrow@label@dist!-90:(@mC@arrow@end)$){#2}; +} +\def\mC@arrow@ii[#1]#2#3{ + \let\mC@arrow@plusminus\@empty + \let\mC@arrow@type\@empty + \let\mC@remainargs\@empty\mC@splitarg{#1} + \ifx\@empty\mC@firstarg% erste Option: Richtung + \def\mC@angle{0} + \def\mC@beta{0} + \def\mC@arrow@label@anchor@up{south} + \def\mC@arrow@label@anchor@down{north} + \def\mC@arrow@label@anchor@add{south} + \def\mC@arrow@label@anchor@sub{south} + \def\mC@anchor{180} + \let\mC@referred@node\@empty + \else + \expandafter\mC@analyze@angle\expandafter{\mC@firstarg} + \def\mC@anchor{180+\mC@angle} + \mC@evaluate@angle{\mC@angle} + \fi + \ifx\mC@referred@node\@empty\def\mC@referred@node{\tikzchainprevious}\fi + \ifx\@empty\mC@secondarg\else% zweite Option: Typ + \def\mC@arrow@type{true} + \let\mC@arrow@type@actual\mC@secondarg + \fi + \let\mC@remainargs\@empty% + \expandafter\mC@splitarg\expandafter{\mC@thirdarg}% + \ifx\@empty\mC@firstarg% dritte Option: Längenfaktor + \def\mC@arrow@factor{1}% + \else% + \edef\mC@arrow@factor{\mC@firstarg}% + \fi% + \ifx\@empty\mC@secondarg% vierte Option: Name + \def\mC@arrow@name{mC@arrow@center}% + \else% + \edef\mC@arrow@name{\mC@secondarg}% + \fi% + \let\mC@remainargs\@empty% + \expandafter\mC@splitarg\expandafter{\mC@thirdarg}% + \ifx\mC@arrow@both\mC@firstarg% fünfte Option: both + \mC@largernode{#2}{#3}% + \else% + \setlength{\mC@arrow@label@width}{0pt}% + \setlength{\mC@arrow@label@height}{0pt}% + \fi% + \ifx\@empty\mC@secondarg% sechste Option: tikz + \let\mC@arrow@tikz\@empty% + \else% + \edef\mC@arrow@tikz{\mC@secondarg,\mC@thirdarg}% + \fi% + \node[on chain=going {at=(\mC@referred@node.\mC@angle)},minimum size=0,inner sep=3pt,outer sep=0,anchor=\mC@anchor,shift=(\mC@angle:.5*\mC@rxn@node@distance)] (@mC@arrow@start){}; + \node[on chain=going {at=(\tikzchainprevious.\mC@angle),shift=($(\mC@angle:.5*\mC@arrow@factor*\mC@arrow@length)$)}, minimum size=0,inner sep=3pt,outer sep=0] (@mC@arrow@end){}; + \ifx\mC@arrow@type\mC@true + \let\mC@arrow@type@valid\mC@false% + \ifx\mC@arrow@type@actual\mC@arrow@type@eq% <=> + \let\mC@arrow@type@valid\mC@true% + \expandafter\draw\expandafter[\mC@arrow@tikz,-mChtip,\mC@arrow@linethickness] let \n1={20+\mC@angle}, \n2={160+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](mC@arrow@center@up){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\draw\expandafter[\mC@arrow@tikz,mChtip-,\mC@arrow@linethickness] let \n1={-20+\mC@angle}, \n2={200+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](mC@arrow@center@down){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \draw[draw=none] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@up,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(mC@arrow@center@up)!\mC@arrow@label@dist!90:(@mC@arrow@end)$){#2}; + \expandafter\node[\expandafter\mC@arrow@downlabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@down,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(mC@arrow@center@down)!\mC@arrow@label@dist!-90:(@mC@arrow@end)$){#3}; + \fi + \ifx\mC@arrow@type@actual\mC@arrow@type@eqq% <=>> + \let\mC@arrow@type@valid\mC@true% + \expandafter\draw\expandafter[\mC@arrow@tikz,-mChtip,\mC@arrow@linethickness] let \n1={20+\mC@angle}, \n2={160+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](mC@arrow@center@up){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\draw\expandafter[\mC@arrow@tikz,mChtip-,\mC@arrow@linethickness] let \n1={-20+\mC@angle} in ($(@mC@arrow@start.\n1)+(\mC@angle:.25*\mC@arrow@factor*\mC@arrow@length)$) --node[pos=.5,inner sep=0](mC@arrow@center@down){} ++($(\mC@angle:.5*\mC@arrow@factor*\mC@arrow@length)$); + \draw[draw=none] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@up,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(mC@arrow@center@up)!\mC@arrow@label@dist!90:(@mC@arrow@end)$){#2}; + \expandafter\node\expandafter[\mC@arrow@downlabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@down,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(mC@arrow@center@down)!\mC@arrow@label@dist!-90:(@mC@arrow@end)$){#3}; + \fi + \ifx\mC@arrow@type@actual\mC@arrow@type@eeq% <<=> + \let\mC@arrow@type@valid\mC@true% + \expandafter\draw\expandafter[\mC@arrow@tikz,-mChtip,\mC@arrow@linethickness] let \n1={20+\mC@angle}, \n2={160+\mC@angle} in ($(@mC@arrow@start.\n1)+(\mC@angle:.25*\mC@arrow@factor*\mC@arrow@length)$) --node[pos=.5,inner sep=0](mC@arrow@center@up){} ++($(\mC@angle:.5*\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\draw\expandafter[\mC@arrow@tikz,mChtip-,\mC@arrow@linethickness] let \n1={-20+\mC@angle}, \n2={200+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](mC@arrow@center@down){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \draw[draw=none] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@up,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(mC@arrow@center@up)!\mC@arrow@label@dist!90:(@mC@arrow@end)$){#2}; + \expandafter\node\expandafter[\mC@arrow@downlabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@down,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(mC@arrow@center@down)!\mC@arrow@label@dist!-90:(@mC@arrow@end)$){#3}; + \fi + \ifx\mC@arrow@type@actual\mC@arrow@type@def% -> + \let\mC@arrow@type@valid\mC@true% + \expandafter\draw\expandafter[\mC@arrow@tikz,-mCtip,\mC@arrow@linethickness,\mC@arrow@tikz] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@up,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height] at ($(\mC@arrow@name)!\mC@arrow@label@dist!90:(@mC@arrow@end)$){#2}; + \expandafter\node\expandafter[\mC@arrow@downlabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@down,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height] at ($(\mC@arrow@name)!\mC@arrow@label@dist!-90:(@mC@arrow@end)$){#3}; + \fi + \ifx\mC@arrow@type@actual\mC@arrow@type@eqv% <-> + \let\mC@arrow@type@valid\mC@true% + \expandafter\draw\expandafter[\mC@arrow@tikz,mCtip-mCtip,\mC@arrow@linethickness] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@up,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(\mC@arrow@name)!\mC@arrow@label@dist!90:(@mC@arrow@end)$){#2}; + \expandafter\node\expandafter[\mC@arrow@downlabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@down,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(\mC@arrow@name)!\mC@arrow@label@dist!-90:(@mC@arrow@end)$){#3}; + \fi + \ifx\mC@arrow@type@actual\mC@arrow@type@back% <- + \let\mC@arrow@type@valid\mC@true% + \expandafter\draw\expandafter[\mC@arrow@tikz,mCtip-,\mC@arrow@linethickness] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@up,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(\mC@arrow@name)!\mC@arrow@label@dist!90:(@mC@arrow@end)$){#2}; + \expandafter\node\expandafter[\mC@arrow@downlabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@down,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(\mC@arrow@name)!\mC@arrow@label@dist!-90:(@mC@arrow@end)$){#3}; + \fi + \ifx\mC@arrow@type@actual\mC@arrow@type@not% -|> + \let\mC@arrow@type@valid\mC@true% + \expandafter\draw\expandafter[\mC@arrow@tikz,-mCtip,\mC@arrow@linethickness] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@up,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(\mC@arrow@name)!.8em!90:(@mC@arrow@end)$){#2}; + \expandafter\node\expandafter[\mC@arrow@downlabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@down,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(\mC@arrow@name)!.8em!-90:(@mC@arrow@end)$){#3}; + \draw ($(mC@arrow@center)!.6em!-110:(@mC@arrow@end)+(\mC@angle:.1em)$)--($(mC@arrow@center)!.6em!70:(@mC@arrow@end)+(\mC@angle:.1em)$); + \draw ($(mC@arrow@center)!.6em!-110:(@mC@arrow@end)+(180+\mC@angle:.1em)$)--($(mC@arrow@center)!.6em!70:(@mC@arrow@end)+(180+\mC@angle:.1em)$); + \fi + \ifx\mC@arrow@type@actual\mC@arrow@type@pm% -+> + \let\mC@arrow@type@valid\mC@true% + \def\mC@arrow@plusminus{true} + \draw[-mCtip,\mC@arrow@linethickness] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \fi + \ifx\mC@arrow@type@valid\mC@false% + \PackageError{myChemistry}{Unknown arrow type \mC@arrow@type@actual}{} + \fi + \else% default: -> + \expandafter\draw\expandafter[\mC@arrow@tikz,-mCtip,\mC@arrow@linethickness] let \n1={\mC@angle}, \n2={180+\mC@angle} in (@mC@arrow@start.\n1) --node[pos=.5,inner sep=0](\mC@arrow@name){} ++($(\mC@angle:\mC@arrow@factor*\mC@arrow@length)$); + \expandafter\node\expandafter[\mC@arrow@uplabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@up,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(\mC@arrow@name)!\mC@arrow@label@dist!90:(@mC@arrow@end)$){#2}; + \expandafter\node\expandafter[\mC@arrow@downlabel@visible,rotate=\mC@beta,anchor=\mC@arrow@label@anchor@down,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height,inner sep=0] at ($(\mC@arrow@name)!\mC@arrow@label@dist!-90:(@mC@arrow@end)$){#3}; + \fi + \ifx\@empty\mC@arrow@plusminus\else + \ifx\@empty#2\@empty\else + \draw (\mC@arrow@name.base) edge[bend left] ++(${0.6667}*(146.3+\mC@angle:.5*\mC@arrow@factor*\mC@arrow@length)$); + \node[anchor=\mC@arrow@label@anchor@add,inner sep=\mC@arrow@label@dist,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height] at ($(\mC@arrow@name.base)+{0.6667}*(146.3+\mC@angle:.5*\mC@arrow@factor*\mC@arrow@length)$) {#2}; + \fi + \ifx\@empty#3\@empty\else + \draw (\mC@arrow@name.base) edge[bend right,-mCtip] ++(${0.6667}*(33.7+\mC@angle:.5*\mC@arrow@factor*\mC@arrow@length)$); + \node[anchor=\mC@arrow@label@anchor@sub,inner sep=\mC@arrow@label@dist,minimum width=\mC@arrow@label@width, minimum height=\mC@arrow@label@height] at ($(\mC@arrow@name.base)+{0.6667}*(33.7+\mC@angle:.5*\mC@arrow@factor*\mC@arrow@length)$) {#3}; + \fi + \fi + \def\mC@arrow@factor{1} +} + % eigene Pfeilspitze ------------------------------------------------------------------ % \pgfarrowsdeclare{mCtip}{mCtip}% { @@ -540,181 +616,37 @@ \pgfpathlineto{\pgfpoint{0pt}{0pt}} \pgfusepathqfillstroke } -% Pfeil zeichnen ---------------------------------------------------------------------- % -\mC@def\mC@arrow@drawing{} -\define@key{arrow}{type}[\mC@arrow@type]{% - \renewcommand{\mC@arrow@currenttype}{#1} - \ifthenelse{\equal{#1}{->}}{ - \let\mC@arrow@plusminus\@empty - \renewcommand{\mC@arrow@drawing}{\draw[-mCtip,\mC@arrow@linethickness,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);} - }{ - \ifthenelse{\equal{#1}{<->}}{ - \let\mC@arrow@plusminus\@empty - \renewcommand{\mC@arrow@drawing}{\draw[mCtip-mCtip,\mC@arrow@linethickness,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);} - }{ - \ifthenelse{\equal{#1}{<-}}{ - \let\mC@arrow@plusminus\@empty - \renewcommand{\mC@arrow@drawing}{\draw[mCtip-,\mC@arrow@linethickness,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);} - }{ - \ifthenelse{\equal{#1}{<=>}}{ - \let\mC@arrow@plusminus\@empty - \renewcommand{\mC@arrow@drawing}{\draw[-mChtip,\mC@arrow@linethickness,text height=0] (\mC@arrow@start@up) -- ++(\mC@arrow@end);\draw[mChtip-,\mC@arrow@linethickness,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}{-|>}}{ - \let\mC@arrow@plusminus\@empty - \setlength{\mC@arrow@argument@aboveshift}{.75em} - \setlength{\mC@arrow@argument@belowshift}{.75em} - \renewcommand{\mC@arrow@cross@draw}{\draw[\mC@arrow@linethickness] ($(@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[\mC@arrow@linethickness] ($(@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[-mCtip,\mC@arrow@linethickness,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);\mC@arrow@cross@draw} - }{ - \ifthenelse{\equal{#1}{-+>}}{ - \def\mC@arrow@plusminus{true} - \renewcommand{\mC@arrow@drawing}{\draw[-mCtip,\mC@arrow@linethickness,text height=0] (0,0) -- node[pos=.5](@arrow@center){} ++(\mC@arrow@end);} - }{ - \PackageError{mychemistry}{Unknown arrow type}% oder Fehler - } - } - } - } - } - } -}% -% ------------------------------------------------------------------------------------- % -% Maße der Nodes der Pfeilargumente bestimmen, größere später an Pfeil weitergeben -\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} -\mC@def\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! -\mC@def\mC@largernode#1#2{ - \@ifundefined{pgfpositionnodelater}{ - \PackageError{mychemistry}{The command \string\pgfpositionnodelater is undefined. Make sure, you have installed the latest version of pgf.} - }{} - {\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} - \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{\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 ---------------------------------------------------------------------- % -\mC@def\mC@arrow#1#2{ - \renewcommand{\mC@arrow@length@factor}{\mC@arrow@currentlength} - \setlength{\mC@arrow@length@actual}{\mC@arrow@currentlength\mC@arrow@length@value} - \ifthenelse{\equal{\mC@arrow@argument@both}{true}}{ - \mC@largernode{#1}{#2} - }{ - \setlength{\mC@arrow@argument@width}{0pt} - \setlength{\mC@arrow@argument@height}{0pt} - } - \draw node[on chain=going \mC@arrow@currentdirection](\mC@arrow@currentname) {\tikz{ - \mC@arrow@drawing - } - }; - \mC@arrow@argument@anchor - \ifx\@empty\mC@arrow@plusminus - \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)$) {#1}; - \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)$) {#2}; - \else - \draw (@arrow@center.base) edge[bend left] ++(146.3+\mC@arrow@argument@angle:.361\mC@arrow@length@actual); - \node[anchor=\mC@arrow@above@anchor,inner sep=.1em] at ($(@arrow@center.base)+(146.3+\mC@arrow@argument@angle:.361\mC@arrow@length@actual)$) {#1}; - \draw (@arrow@center.base) edge[bend right,-mCtip] ++(33.7+\mC@arrow@argument@angle:.361\mC@arrow@length@actual); - \node[anchor=\mC@arrow@above@anchor,inner sep=.1em] at ($(@arrow@center.base)+(33.7+\mC@arrow@argument@angle:.361\mC@arrow@length@actual)$) {#2}; - \fi - \setlength{\mC@arrow@argument@aboveshift}{2pt} - \setlength{\mC@arrow@argument@belowshift}{2pt} -} - -% Voreinstellungen: -\presetkeys% - {arrow} - {direction=\mC@arrow@direction,length=\mC@arrow@length,type=\mC@arrow@type,aboveshift=\mC@arrow@argument@shift,belowshift=\mC@arrow@argument@shift} - {} - -% Eigentlicher Befehl: -\mC@def\arrow{\@ifnextchar[{\mC@arrow@i}{\setkeys{arrow}{}\mC@arrow}} -\mC@def\mC@arrow@i[#1]{% [<direction>,<type>,<length>,<name>,both] - \let\mC@remainargs\@empty\mC@splitarg{#1}% - \ifx\@empty\mC@firstarg% erste Option: direction - \def\mC@arrow@key@direction{right}% - \else% - \let\mC@arrow@key@direction\mC@firstarg% - \fi% - \ifx\@empty\mC@secondarg% zweite Option: type - \def\mC@arrow@key@type{->}% - \else% - \let\mC@arrow@key@type\mC@secondarg% - \fi% - \let\mC@remainargs\@empty% - \expandafter\mC@splitarg\expandafter{\mC@thirdarg}% - \ifx\@empty\mC@firstarg% dritte Option: length - \def\mC@arrow@key@length{1.0}% - \else% - \let\mC@arrow@key@length\mC@firstarg% - \fi% - \ifx\@empty\mC@secondarg% vierte Option: name - \let\mC@arrow@key@name\@empty% - \else% - \def\mC@arrow@key@name{\mC@secondarg}% - \fi% - \ifx\@empty\mC@thirdarg% fünfte Option: both - \let\mC@arrow@key@both\@empty% - \else% - \let\mC@arrow@key@both\mC@thirdarg% - \fi% - \setkeys{arrow}{direction=\mC@arrow@key@direction,type={\mC@arrow@key@type},length={\mC@arrow@key@length},name=\mC@arrow@key@name,\mC@arrow@key@both}\mC@arrow% -} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MERGE ------------------------------------------------------------------------------- % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\mC@def\mC@merge@length@default{3em} -\mC@def\mC@merge@length@value{\mC@merge@length@default} +% \merge[<label>,<pos>,<length>]{<target>}{<start a>}{<start b>} +\def\mC@merge@length@default{3em} +\def\mC@merge@length@value{\mC@merge@length@default} % Basisbefehle ------------------------------------------------------------------------ % -\mC@def\mC@merge@right{ +\def\mC@merge@right{ \draw[mCtip-,\mC@arrow@linethickness] ($(\mC@merge@to.west)+(-\mC@rxn@node@distance,0)$) --node[midway,above,yshift=.1em]{\mC@merge@arg} ++(-\mC@merge@length,0) node(crossing) {}; - \draw[thick] ($(\mC@merge@from@one.east)+(\mC@rxn@node@distance,0)$) -| (crossing.base); - \draw[thick] ($(\mC@merge@from@two.east)+(\mC@rxn@node@distance,0)$) -| (crossing.base); + \draw[\mC@arrow@linethickness] ($(\mC@merge@from@one.east)+(\mC@rxn@node@distance,0)$) -| (crossing.base); + \draw[\mC@arrow@linethickness] ($(\mC@merge@from@two.east)+(\mC@rxn@node@distance,0)$) -| (crossing.base); } -\mC@def\mC@merge@above{ +\def\mC@merge@above{ \draw[mCtip-,\mC@arrow@linethickness] ($(\mC@merge@to.south)+(0,-\mC@rxn@node@distance)$) --node[midway,right,xshift=.1em]{\mC@merge@arg} ++(0,-\mC@merge@length) node(crossing) {}; - \draw[thick] (crossing.base) -| ($(\mC@merge@from@one.north)+(0,\mC@rxn@node@distance)$); - \draw[thick] (crossing.base) -| ($(\mC@merge@from@two.north)+(0,\mC@rxn@node@distance)$); + \draw[\mC@arrow@linethickness] (crossing.base) -| ($(\mC@merge@from@one.north)+(0,\mC@rxn@node@distance)$); + \draw[\mC@arrow@linethickness] (crossing.base) -| ($(\mC@merge@from@two.north)+(0,\mC@rxn@node@distance)$); } -\mC@def\mC@merge@left{ +\def\mC@merge@left{ \draw[mCtip-,\mC@arrow@linethickness] ($(\mC@merge@to.east)+(\mC@rxn@node@distance,0)$) --node[midway,above,yshift=.1em]{\mC@merge@arg} ++(\mC@merge@length,0) node(crossing) {}; - \draw[thick] ($(\mC@merge@from@one.west)+(-\mC@rxn@node@distance,0)$) -| (crossing.base); - \draw[thick] ($(\mC@merge@from@two.west)+(-\mC@rxn@node@distance,0)$) -| (crossing.base); + \draw[\mC@arrow@linethickness] ($(\mC@merge@from@one.west)+(-\mC@rxn@node@distance,0)$) -| (crossing.base); + \draw[\mC@arrow@linethickness] ($(\mC@merge@from@two.west)+(-\mC@rxn@node@distance,0)$) -| (crossing.base); } -\mC@def\mC@merge@below{ +\def\mC@merge@below{ \draw[mCtip-,\mC@arrow@linethickness] ($(\mC@merge@to.north)+(0,\mC@rxn@node@distance)$) --node[midway,right,xshift=.1em]{\mC@merge@arg} ++(0,\mC@merge@length) node(crossing) {}; - \draw[thick] (crossing.base) -| ($(\mC@merge@from@one.south)+(0,-\mC@rxn@node@distance)$); - \draw[thick] (crossing.base) -| ($(\mC@merge@from@two.south)+(0,-\mC@rxn@node@distance)$); + \draw[\mC@arrow@linethickness] (crossing.base) -| ($(\mC@merge@from@one.south)+(0,-\mC@rxn@node@distance)$); + \draw[\mC@arrow@linethickness] (crossing.base) -| ($(\mC@merge@from@two.south)+(0,-\mC@rxn@node@distance)$); } % eigentlicher Befehl ----------------------------------------------------------------- % -\mC@def\mC@merge{\@ifnextchar[{\mC@merge@ii}{\mC@merge@i}} -\mC@def\mC@merge@i#1#2#3{ +\def\mC@merge{\@ifnextchar[{\mC@merge@ii}{\mC@merge@i}} +\def\mC@merge@i#1#2#3{ \def\mC@merge@length{\mC@merge@length@value} \let\mC@merge@arg\@empty \def\mC@merge@to{#1} @@ -722,7 +654,7 @@ \def\mC@merge@from@two{#3} \mC@merge@below } -\mC@def\mC@merge@ii[#1]#2#3#4{ +\def\mC@merge@ii[#1]#2#3#4{ \let\mC@remainargs\@empty\mC@splitarg{#1} \ifx\mC@firstarg\@empty \let\mC@merge@arg\@empty @@ -743,9 +675,9 @@ \expandafter\csname mC@merge@\mC@secondarg\endcsname \fi } -\mC@def\merge{\mC@merge} +\def\merge{\mC@merge} -\mC@def\setmergelength#1{ +\def\setmergelength#1{ \ifx\@empty#1\@empty \def\mC@merge@length@value{\mC@merge@length@default} \else @@ -760,7 +692,7 @@ \setlength{\mC@rxn@node@distance@default}{1em} \newlength{\mC@rxn@node@distance} \setlength{\mC@rxn@node@distance}{\mC@rxn@node@distance@default} -\mC@def\setrcndist#1{% +\def\setrcndist#1{% \ifx\@empty#1\@empty% \setlength{\mC@rxn@node@distance}{\mC@rxn@node@distance@default}% \else% @@ -770,17 +702,18 @@ % ------------------------------------------------------------------------------------- % % Schema ------------------------------------------------------------------------------ % % ------------------------------------------------------------------------------------- % -\mC@def\mC@rs@scale{1.0} % Default-Skalierung -\mC@def\mC@rs@currentscale{\mC@rs@scale} % -\mC@def\setschemename#1{\def\mC@rs@name{#1}} % -\mC@def\mC@rs@caption{} % Beschriftung -\mC@def\mC@rs@label{} % Label -\mC@def\mC@rs@currentlabel{\mC@rs@label} % -\mC@def\mC@rs@align{center} % -\mC@def\mC@rs@right{right} % -\mC@def\mC@rs@center{center} % -\mC@def\mC@rs@left{left} % -\mC@def\setschemealign#1{% % +% \begin{rxnscheme}[<label>,<placement>,<align>,<scale factor>,<name>]{<caption>} +\def\mC@rs@scale{1.0} % Default-Skalierung +\def\mC@rs@currentscale{\mC@rs@scale} % +\def\setschemename#1{\def\mC@rs@name{#1}} % +\def\mC@rs@caption{} % Beschriftung +\def\mC@rs@label{} % Label +\def\mC@rs@currentlabel{\mC@rs@label} % +\def\mC@rs@align{center} % +\def\mC@rs@right{right} % +\def\mC@rs@center{center} % +\def\mC@rs@left{left} % +\def\setschemealign#1{% % \ifx\@empty#1\@empty% % \def\mC@rs@align{center}% % \else% % @@ -792,8 +725,8 @@ \newfloat{rxnfloat}{\mC@rs@currentplacement}{rxnscheme} \floatname{rxnfloat}{\mC@rs@name} % Name ändern % eigentliche Umgebung: -\mC@def\mC@rxnscheme{\@ifnextchar[{\mC@rxnscheme@ii}{\let\mC@rs@currentlabel\@empty\mC@rxnscheme@i}} -\mC@def\mC@rxnscheme@ii[#1]{% [<label>,<placement>,<align>,<scale>,<name>] +\def\mC@rxnscheme{\@ifnextchar[{\mC@rxnscheme@ii}{\let\mC@rs@currentlabel\@empty\mC@rxnscheme@i}} +\def\mC@rxnscheme@ii[#1]{% [<label>,<placement>,<align>,<scale>,<name>] \let\mC@remainargs\@empty\mC@splitarg{#1}% \ifx\@empty\mC@firstarg% erste Option \let\mC@rs@currentlabel\@empty% @@ -822,7 +755,7 @@ \fi% \mC@rxnscheme@i% } -\mC@def\mC@rxnscheme@i#1{% +\def\mC@rxnscheme@i#1{% \def\mC@rs@caption{#1}% \rxnfloat% \ifx\mC@rs@align\mC@rs@center \centering \fi% @@ -832,8 +765,8 @@ \tikzpicture[every picture/.style={scale=\mC@rs@currentscale},start chain,node distance=\mC@rxn@node@distance,inner sep=0pt,outer sep=0pt]% \mC@dummy@ii% } -\mC@def\rxnscheme{\mC@rxnscheme} -\mC@def\endrxnscheme{% +\def\rxnscheme{\mC@rxnscheme} +\def\endrxnscheme{% \endtikzpicture% \caption{\mC@rs@caption}% \ifx\@empty\mC@rs@currentlabel\else% @@ -845,21 +778,22 @@ % ------------------------------------------------------------------------------------- % % einfache Reaktion ------------------------------------------------------------------- % % ------------------------------------------------------------------------------------- % -\mC@def\mC@reaction@scale{1.0} -\mC@def\mC@reaction@align{center} -\mC@def\setrxnalign#1{ +% \begin{rxn}[<align>,<scalefactor>] +\def\mC@reaction@scale{1.0} +\def\mC@reaction@align{center} +\def\setrxnalign#1{ \ifx\@empty#1\@empty \def\mC@reaction@align{center} \else \def\mC@reaction@align{#1} \fi } -\mC@def\mC@reaction@right{right} -\mC@def\mC@reaction@center{center} -\mC@def\mC@reaction@left{left} +\def\mC@reaction@right{right} +\def\mC@reaction@center{center} +\def\mC@reaction@left{left} -\mC@def\mC@rxn{\@ifnextchar[{\mC@rxn@ii}{\mC@rxn@i}} -\mC@def\mC@rxn@ii[#1]{% +\def\mC@rxn{\@ifnextchar[{\mC@rxn@ii}{\mC@rxn@i}} +\def\mC@rxn@ii[#1]{% \let\mC@remainargs\@empty\mC@splitarg{#1}% \ifx\@empty\mC@firstarg% \let\mC@reaction@align\mC@reaction@center% @@ -873,7 +807,7 @@ \fi% \mC@rxn@i } -\mC@def\mC@rxn@i{% +\def\mC@rxn@i{% \hspace*{0pt}% \ifx\mC@reaction@align\mC@reaction@center% \center% @@ -885,12 +819,12 @@ \flushright% \fi% \mC@bondlength\mC@bondshape\mC@atomsize% - \tikzpicture[every picture/.style={scale=\mC@reaction@scale},start chain,node distance=\mC@rxn@node@distance,inner sep=0pt,outer sep=0pt]% + \begin{tikzpicture}[every picture/.style={scale=\mC@reaction@scale},start chain,node distance=\mC@rxn@node@distance,inner sep=0pt,outer sep=0pt]% \mC@dummy@ii% } -\mC@def\rxn{\mC@rxn} -\mC@def\endrxn{% - \endtikzpicture% +\def\rxn{\mC@rxn} +\def\endrxn{% + \end{tikzpicture}% \ifx\mC@reaction@align\mC@reaction@center% \endcenter% \fi% @@ -906,89 +840,174 @@ % REAKTANDEN -------------------------------------------------------------------------- % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Standardreaktand -------------------------------------------------------------------- % -\mC@def\mC@reactant{\@ifnextchar[{\mC@reactant@ii}{\mC@reactant@i}} -\mC@def\mC@reactant@i#1{\def\mC@firstarg{on chain=going right}\let\mC@secondarg\@empty\let\mC@thirdarg\@empty\mC@reactant@iii{#1}} -\mC@def\mC@reactant@ii[#1]#2{ +% \reactant[<pos>,<name>,<tikz>]{<something>} +\def\reactant{\@ifnextchar[{\reactant@ii}{\reactant@i}} +\def\reactant@i#1{ + \expandafter\node\expandafter[\mC@reactant@visible,on chain=going {at=(\tikzchainprevious.0)},anchor=180,shift=(0:\mC@rxn@node@distance)]{\scantokens{\relax#1}}; +} +\def\reactant@ii[#1]#2{ \let\mC@remainargs\@empty\mC@splitarg{#1} - \ifx\mC@firstarg\@empty\def\mC@reactant@alignment{right}\else\let\mC@reactant@alignment\mC@firstarg\fi - \def\mC@firstarg{on chain=going \mC@reactant@alignment} - \mC@reactant@iii{#2}} -\mC@def\mC@reactant@iii#1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg](\mC@secondarg){\scantokens{\relax#1}};}% scantokens nötig, da sonst eine Dreifanchbindung ~ vor () mit falschem catcode interpretiert wird -\mC@def\reactand{\mC@reactant}% old command -\mC@def\reactant{\mC@reactant}% new correctly spelled command + \ifx\@empty\mC@firstarg% erste Option: <pos>, zweite Option: <name>, dritte Option: <tikz> + \def\mC@angle{0} + \def\mC@anchor{180} + \let\mC@referred@node\@empty + \else + \expandafter\mC@analyze@angle\expandafter{\mC@firstarg} + \def\mC@anchor{180+\mC@angle} + \fi + \ifx\mC@referred@node\@empty\def\mC@referred@node{\tikzchainprevious}\fi + \expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@thirdarg\expandafter,\mC@reactant@visible,on chain=going {at=(\mC@referred@node.\mC@angle)},anchor=\mC@anchor,shift=(\mC@angle:\mC@rxn@node@distance)](\mC@secondarg){\scantokens{\relax#2}}; +} +\let\reactand\reactant % Mesomerie --------------------------------------------------------------------------- % -\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{ +% \mesomeric[<pos>,<name>,<tikz>]{<something>} +\def\mesomeric{\@ifnextchar[{\mesomeric@ii}{\mesomeric@i}} +\def\mesomeric@i#1{ + \node[on chain=going {at=(\tikzchainprevious.0),shift=($(0:\mC@rxn@node@distance)$)},anchor=180,shift=(0:\mC@rxn@node@distance),inner sep=1pt,left delimiter={[},right delimiter={]}]{\tikzpicture[start branch]\scantokens{\relax#1}\endtikzpicture}; +} +\def\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]\scantokens{\relax#1}\endtikzpicture};}% scantokens nötig, da sonst eine Dreifanchbindung ~ vor () mit falschem catcode interpretiert wird -\mC@def\mesomeric{\mC@mesomeric} + \ifx\@empty\mC@firstarg% erste Option: <pos>, zweite Option: <name>, dritte Option: <tikz> + \def\mC@angle{0} + \def\mC@anchor{180} + \let\mC@referred@node\@empty + \else + \expandafter\mC@analyze@angle\expandafter{\mC@firstarg} + \def\mC@anchor{180+\mC@angle} + \fi + \ifx\mC@referred@node\@empty\def\mC@referred@node{\tikzchainprevious}\fi + \expandafter\node\expandafter[\mC@thirdarg,on chain=going {at=(\mC@referred@node.\mC@angle)},anchor=\mC@anchor,shift=(\mC@angle:\mC@rxn@node@distance),inner sep=1pt,left delimiter={[},right delimiter={]}](\mC@secondarg){\tikzpicture[start branch]\scantokens{\relax#2}\endtikzpicture}; +} % Mesomerie-Pfeil --------------------------------------------------------------------- % -\mC@def\marrow{\@ifnextchar[{\mC@marrow@i}{\mC@marrow@ii}} -\mC@def\mC@marrow@i[#1]{\arrow[#1,<->,.5]{}{}} -\mC@def\mC@marrow@ii{\arrow[,<->,.5]{}{}} +% \marrow[<pos>] +\def\marrow{\@ifnextchar[{\mC@marrow@ii}{\mC@marrow@i}} +\def\mC@marrow@ii[#1]{\arrow[#1,<->,.5]{}{}} +\def\mC@marrow@i{\arrow[,<->,.5]{}{}} % Anywhere ---------------------------------------------------------------------------- % -\mC@def\mC@anywhere{\@ifnextchar[{\mC@anywhere@ii}{\mC@anywhere@i}} -\mC@def\mC@anywhere@ii[#1]#2#3{\node[#2](#1){#3};} -\mC@def\mC@anywhere@i#1#2{\node[#1]{#2};} -\mC@def\anywhere{\mC@anywhere} +% \anywhere{<pos>,<name>,<tikz>}{<something>} +\def\anywhere#1#2{ + \let\mC@remainargs\@empty\mC@splitarg{#1}% erste Option: <pos>, zweite Option: <name>, dritte Option: <tikz> + \ifx\mC@firstarg\@empty + \PackageError{mychemistry}{\string\anywhere: positioning missing}{See the myChemistry package documentation for explanation} + \else + \expandafter\mC@if@instr\expandafter{\mC@firstarg}{=}{ + \edef\mC@anywhere@positioning{\mC@firstarg} + }{ + \expandafter\mC@analyze@angle\expandafter{\mC@firstarg} + \def\mC@anchor{180+\mC@angle} + \ifx\mC@referred@node\@empty + \PackageError{mychemistry}{You can't use `angle' to position \string\anywhere. You need to use `name.angle'}{See the myChemistry package documentation for explanation} + \else + \def\mC@anywhere@positioning{at=(\mC@referred@node.\mC@angle),anchor=\mC@anchor} + \fi + } + \fi + \expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@thirdarg\expandafter,\mC@anywhere@positioning](\mC@secondarg){#2}; +} % Dummy ------------------------------------------------------------------------------- % -\mC@def\dummy{\@ifnextchar[{\mC@dummy@i}{\mC@dummy@ii}} -\mC@def\mC@dummy@i[#1]{\draw node[on chain,xshift=-\mC@rxn@node@distance](#1){};} -\mC@def\mC@dummy@ii{\draw node[on chain,xshift=-\mC@rxn@node@distance]{};} +% \dummy[<name>] +\def\dummy{\@ifnextchar[{\mC@dummy@i}{\mC@dummy@ii}} +\def\mC@dummy@i[#1]{\draw node[on chain,xshift=-\mC@rxn@node@distance](#1){};} +\def\mC@dummy@ii{\draw node[on chain,xshift=-\mC@rxn@node@distance]{};} % Uebergangszustand ------------------------------------------------------------------- % -\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{ +% \transition[<pos>,<name>,<tikz>]{<something>} +\def\transition{\@ifnextchar[{\transition@ii}{\transition@i}} +\def\transition@i#1{ + \expandafter\node\expandafter[\mC@reactant@visible,on chain=going {at=(\tikzchainprevious.0)},anchor=180,shift=(0:\mC@rxn@node@distance),anchor=180,inner sep=3pt,left delimiter={[},right delimiter={]}](mC@transition@name){\scantokens{\relax#1}}; + \node at ($(mC@transition@name.north east)+(.7em,0)$) {$\ddagger$}; +} +\def\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){\scantokens{\relax#1}} node[above right=of \mC@secondarg,xshift=-.2em,yshift=-1.2em] {$\ddagger$};}% scantokens nötig, da sonst eine Dreifanchbindung ~ vor () mit falschem catcode interpretiert wird -\mC@def\transition{\mC@transition} + \ifx\@empty\mC@firstarg% erste Option: <pos> + \def\mC@angle{0} + \def\mC@anchor{180} + \let\mC@referred@node\@empty + \else + \expandafter\mC@analyze@angle\expandafter{\mC@firstarg} + \def\mC@anchor{180+\mC@angle} + \fi + \ifx\@empty\mC@secondarg% zweite Option: <name>, dritte Option: <tikz> + \def\mC@transition@name{mC@transition@name} + \else + \let\mC@transition@name\mC@secondarg + \fi + \ifx\mC@referred@node\@empty\def\mC@referred@node{\tikzchainprevious}\fi + \expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\mC@reactant@visible\expandafter,\mC@thirdarg,on chain=going {at=(\mC@referred@node.\mC@angle)},anchor=\mC@anchor,shift=(\mC@angle:\mC@rxn@node@distance),inner sep=3pt,left delimiter={[},right delimiter={]}](\mC@transition@name){\scantokens{\relax#2}}; + \node at ($(\mC@transition@name.north east)+(.7em,0)$) {$\ddagger$}; +} % Abzweigung -------------------------------------------------------------------------- % -\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]\scantokens{\relax#1}\endtikzpicture};}% scantokens nötig, da sonst eine Dreifanchbindung ~ vor () mit falschem catcode interpretiert wird -\mC@def\branch{\mC@branch} +% \branch[<pos>,<name>,<tikz>]{<formulae>} +% <pos>: default: on chain=going "right" (0°) +% on chain=going <somewhere> +% <somewhere>=of <name> +% <angle> (sitzt auf der Kette) +% <name>.<angle> (sitzt nicht auf der Kette) +\def\mC@branch{\@ifnextchar[{\mC@branch@ii}{\mC@branch@i}} +\def\mC@branch@i#1{ + \expandafter\def\expandafter\mC@branch@positioning\expandafter{\mC@branch@visible,on chain=going {at=(\tikzchainprevious.0)},anchor=180,shift=(0:\mC@rxn@node@distance)} + \let\mC@secondarg\@empty\let\mC@thirdarg\@empty + \mC@branch@iii{#1}} +\def\mC@branch@ii[#1]#2{ + \let\mC@remainargs\@empty\mC@splitarg{#1}% erste Option: <pos>, zweite Option: <name>, dritte Option: <tikz> + \ifx\mC@firstarg\@empty + \expandafter\def\expandafter\mC@branch@positioning\expandafter{\mC@branch@visible,on chain=going {at=(\tikzchainprevious.0)},anchor=180,shift=(0:\mC@rxn@node@distance)} + \else + \expandafter\mC@if@instr\expandafter{\mC@firstarg}{=}{ + \edef\mC@branch@positioning{\mC@branch@visible,\mC@firstarg} + }{ + \expandafter\mC@analyze@angle\expandafter{\mC@firstarg} + \def\mC@anchor{180+\mC@angle} + \ifx\mC@referred@node\@empty + \expandafter\def\expandafter\mC@branch@positioning\expandafter{\mC@branch@visible,on chain=going {at=(\tikzchainprevious.\mC@angle)},anchor=\mC@anchor,shift=(\mC@angle:\mC@rxn@node@distance)} + \else + \expandafter\def\expandafter\mC@branch@positioning\expandafter{\mC@branch@visible,at=(\mC@referred@node.\mC@angle),anchor=\mC@anchor,shift=(\mC@angle:\mC@rxn@node@distance)} + \fi + } + \fi + \mC@branch@iii{#2}} +\def\mC@branch@iii#1{ + \expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@branch@positioning\expandafter,\mC@thirdarg](\mC@secondarg){\tikzpicture[start branch]\scantokens{\relax#1}\endtikzpicture};}% scantokens nötig, da sonst eine Dreifachbindung ~ vor () mit falschem catcode interpretiert wird +\def\branch{\mC@branch} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Sonstiges --------------------------------------------------------------------------- % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Elektronenverschiebungspfeile ------------------------------------------------------- % -\mC@def\elmove{\@ifnextchar[{\mC@elmove@i}{\mC@elmove@ii}} -\mC@def\mC@elmove@i[#1]#2#3#4#5{\chemmove{\draw[#1](#2).. controls +(#3) and +(#5)..(#4);}} -\mC@def\mC@elmove@ii#1#2#3#4{\chemmove{\draw[->,red,shorten <=3pt,shorten >=1pt](#1).. controls +(#2) and +(#4)..(#3);}} +\def\elmove{\@ifnextchar[{\mC@elmove@i}{\mC@elmove@ii}} +\def\mC@elmove@i[#1]#2#3#4#5{\chemmove{\draw[#1](#2).. controls +(#3) and +(#5)..(#4);}} +\def\mC@elmove@ii#1#2#3#4{\chemmove{\draw[->,red,shorten <=3pt,shorten >=1pt](#1).. controls +(#2) and +(#4)..(#3);}} + +% Plus -------------------------------------------------------------------------------- % +\def\mC@chemand{\@ifnextchar[{\mC@chemand@ii}{\mC@chemand@i}} +\def\mC@chemand@i{\reactant{\chemsign[0pt]{+}}} +\def\mC@chemand@ii[#1]{\reactant[#1]{\chemsign[0pt]{+}}} +\def\chemand{\mC@chemand} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Setup myChemistry ------------------------------------------------------------------- % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Bindungslänge ----------------------------------------------------------------------- % -\mC@def\mC@bondlength@default{1.8em} -\mC@def\mC@bondlength{\setatomsep{\mC@bondlength@default}} -\mC@def\setbondlength#1{ +\def\mC@bondlength@default{1.8em} +\def\mC@bondlength{\setatomsep{\mC@bondlength@default}} +\def\setbondlength#1{ \ifx\@empty#1\@empty \def\mC@bondlength{\setatomsep{\mC@bondlength@default}} \else \def\mC@bondlength{\setatomsep{#1}} \fi } -% \let\bondlength\setbondlength % Keilbindungen ----------------------------------------------------------------------- % -\mC@def\mC@bondshape@one{3pt} -\mC@def\mC@bondshape@two{.5pt} -\mC@def\mC@bondshape@three{1pt} -\mC@def\setbondshape#1#2#3{ +\def\mC@bondshape@one{3pt} +\def\mC@bondshape@two{.5pt} +\def\mC@bondshape@three{1pt} +\def\setbondshape#1#2#3{ \ifx\@empty#1\@empty \renewcommand{\mC@bondshape@one}{3pt} \else @@ -1005,37 +1024,24 @@ \renewcommand{\mC@bondshape@three}{#3} \fi } -% \let\bondshape\setbondshape -\mC@def\mC@bondshape{\setcrambond{\mC@bondshape@one}{\mC@bondshape@two}{\mC@bondshape@three}} +\def\mC@bondshape{\setcrambond{\mC@bondshape@one}{\mC@bondshape@two}{\mC@bondshape@three}} % Atomgröße --------------------------------------------------------------------------- % -\mC@def\mC@atomsize@default{\small} -\mC@def\mC@atomsize{\mC@atomsize@default} -\mC@def\setatomsize#1{ +\def\mC@atomsize@default{\small} +\def\mC@atomsize{\mC@atomsize@default} +\def\setatomsize#1{ \ifx\@empty#1\@empty \renewcommand{\mC@atomsize}{\mC@atomsize@default} \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}[\mC@arrow@length@default]{% +% allg. Setup ------------------------------------------------------------------------- % +\def\mCsetup#1{\setkeys{setup}{#1}} +\define@key{setup}{arrowlabel}[\mC@arrow@label@dist@def]{% + \setarrowlabel{#1}} +\define@key{setup}{arrowlength}[\mC@arrow@length@def]{% \setarrowlength{#1}} \define@key{setup}{arrowline}[\mC@arrow@linethickness@default]{% \setarrowline{#1}} @@ -1043,6 +1049,9 @@ \setatomsize{#1}} \define@key{setup}{bondlength}[\mC@bondlength@default]{% \setbondlength{#1}} +% \define@key{setup}{bondshape}[{\mC@bondshape@one,\mC@bondshape@two\mC@bondshape@three}]{% +% \let\mC@remainargs\@empty\mC@splitarg{#1}% +% \setbondshape{\mC@firstarg}{\mC@secondarg}{\mC@thirdarg}} \define@key{setup}{rcndist}[\mC@rxn@node@distance@default]{% \setrcndist{#1}} \define@key{setup}{rxnalign}[center]{% @@ -1055,6 +1064,7 @@ \define@key{setup}{mergelength}[\mC@merge@length@default]{ \setmergelength{#1}} \define@key{setup}{reset}[]{% + \setarrowlabel{} \setarrowlength{} \setarrowline{} \setmergelength{} @@ -1069,58 +1079,21 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NODES SICHTBAR/UNSICHTBAR MACHEN ---------------------------------------------------- % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand\makevisible{ - \def\mC@reactant@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg,draw=red!60,solid](\mC@secondarg){\scantokens{\relax##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]\scantokens{\relax##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){\scantokens{\relax##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@value} - \ifthenelse{\equal{\mC@arrow@argument@both}{true}}{ - \mC@largernode{##2}{##3} - }{ - \setlength{\mC@arrow@argument@width}{0pt} - \setlength{\mC@arrow@argument@height}{0pt} - } - \draw node[solid,on chain=going \mC@arrow@currentdirection](\mC@arrow@currentname) {\tikz{ - \mC@arrow@drawing - } - }; - \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} - } +\let\mC@reactant@visible\@empty +\let\mC@arrow@uplabel@visible\@empty +\let\mC@arrow@downlabel@visible\@empty +\let\mC@branch@visible\@empty +\def\makevisible{ + \def\mC@reactant@visible{draw=red!60,solid} + \def\mC@arrow@uplabel@visible{draw=green!60,solid} + \def\mC@arrow@downlabel@visible{draw=blue!60,solid} + \def\mC@branch@visible{draw=cyan,solid} } - -\newcommand\makeinvisible{ - \def\mC@reactant@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg](\mC@secondarg){\scantokens{\relax##1}};} - \def\mC@branch@iii##1{\expandafter\expandafter\expandafter\node\expandafter\expandafter\expandafter[\expandafter\mC@firstarg\expandafter,\mC@thirdarg](\mC@secondarg){\tikzpicture[start branch]\scantokens{\relax##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){\scantokens{\relax##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@value} - \ifthenelse{\equal{\mC@arrow@argument@both}{true}}{ - \mC@largernode{##2}{##3} - }{ - \setlength{\mC@arrow@argument@width}{0pt} - \setlength{\mC@arrow@argument@height}{0pt} - } - \draw node[on chain=going \mC@arrow@currentdirection](\mC@arrow@currentname) {\tikz{ - \mC@arrow@drawing - } - }; - \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} - } +\def\makeinvisible{ + \let\mC@reactant@visible\@empty + \let\mC@arrow@uplabel@visible\@empty + \let\mC@arrow@downlabel@visible\@empty + \let\mC@branch@visible\@empty } % ------------------------------------------------------------------------------------- % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |