summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mychemistry
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-04-28 22:41:52 +0000
committerKarl Berry <karl@freefriends.org>2011-04-28 22:41:52 +0000
commit89ceb55bc96c0d36600b617ba97186294acfaa06 (patch)
treec2db7a34c0e4cabd3a196b73af780bb62b7c3e3a /Master/texmf-dist/tex/latex/mychemistry
parent38bf042280d81ae16f304a6beaf48995745f31c6 (diff)
mychemistry 1.5.1 (28apr11)
git-svn-id: svn://tug.org/texlive/trunk@22242 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mychemistry')
-rw-r--r--Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty98
1 files changed, 64 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty b/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty
index 60a6b968d60..38325495786 100644
--- a/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty
+++ b/Master/texmf-dist/tex/latex/mychemistry/mychemistry.sty
@@ -1,10 +1,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------------------------------------------------------------------------------- %
% - myChemistry - mychemistry.sty ----------------------------------------------------- %
-% - Creating reaction schemes with LaTeX and ChemFig ---------------------------------- %
+% - Create reaction schemes with LaTeX and ChemFig ------------------------------------ %
% ------------------------------------------------------------------------------------- %
% - Clemens Niederberger -------------------------------------------------------------- %
-% - 2011/04/23 ------------------------------------------------------------------------ %
+% - 2011/04/27 ------------------------------------------------------------------------ %
% ------------------------------------------------------------------------------------- %
% - http://www.niederberger-berlin.net/2011/02/latex-mychemistry/ --------------------- %
% - kontakt@niederberger-berlin.net --------------------------------------------------- %
@@ -26,8 +26,8 @@
% - - %
% - The Current Maintainer of this work is Clemens Niederberger. - %
% - - %
-% - This work consists of the files mychemistry.sty, mychemistry_de.tex and - %
-% - mychemistry_en.tex - %
+% - This work consists of the files mychemistry.sty, mychemistry_de.tex, - %
+% - mychemistry_en.tex, examples.tex - %
% ------------------------------------------------------------------------------------- %
% - 2011/02/24 version 1.0 - %
% - first release to CTAN - %
@@ -101,6 +101,10 @@
% - arrow types <=>> and <<=> added - %
% - arrow type -+> modified: more flexible - %
% - bugfixes in error-handling - %
+% - 2011/04/27 version 1.5.1 - %
+% - removed bondwidth.tex - %
+% - \arrow, \reactant, \mesomeric, \transition, \anywhere, \dummy, \branch, - %
+% - and \chemand only defined inside scheme environments - %
% ------------------------------------------------------------------------------------- %
% - TODO: - %
% - work on how chemistry-packages are automatically loaded; - %
@@ -111,10 +115,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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@version{1.5.1}
+\def\mC@date@de{27. April 2011}
+\def\mC@date@en{April 27th 2011}
+\def\mC@date{2011/04/27}
\def\mC@name{myChemistry}
\ProvidesPackage{mychemistry}[\mC@date\space v\mC@version]
\typeout{}
@@ -125,15 +129,6 @@
% 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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -259,15 +254,18 @@
\def\mC@false{false}
% Optional Argument Analysis ---------------------------------------------------------- %
% Prüfen ob #2 in #1 enthalten ist
+% (das Makro ist eine Kopie von \CF@if@instr in chemfig.tex von Christian Tellechea)
\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
+% (das Makro ist eine Kopie von \CF@analyze@movearg in chemfig.tex von Christian Tellechea)
\def\mC@splitfirst#1,#2\@nil#3{%
\def#3{#1}\def\mC@remainargs{#2}%
}
% ein durch , in 3 Teile getrenntes Argument splitten
+% (das Makro ist eine Abwandlung von \CF@analyze@movearg in chemfig.tex von Christian Tellechea)
\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}}
@@ -286,7 +284,8 @@
\def\mC@vert@i{90}
\def\mC@vert@ii{-90}
\def\mC@vert@iii{270}
-% Richtung in Bezug auf node oder nicht?
+% Richtung in Bezug auf node oder nicht?
+% (nur eine Kopie/Variante von \mC@splitfirst, das wiederum eine Kopie von \CF@analyze@movearg in chemfig.tex von Christian Tellechea ist)
\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:
@@ -443,7 +442,7 @@
}
% ------------------------------------------------------------------------------------- %
% Pfeil zeichnen:
-\def\arrow{\@ifnextchar[{\mC@arrow@ii}{\mC@arrow@i}}
+\def\mC@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){};
@@ -756,6 +755,14 @@
\mC@rxnscheme@i%
}
\def\mC@rxnscheme@i#1{%
+ \let\arrow\mC@arrow%
+ \let\reactant\mC@reactant%
+ \let\mesomeric\mC@mesomeric%
+ \let\transition\mC@transition%
+ \let\anywhere\mC@anywhere%
+ \let\dummy\mC@dummy%
+ \let\branch\mC@branch%
+ \let\chemand\mC@chemand%
\def\mC@rs@caption{#1}%
\rxnfloat%
\ifx\mC@rs@align\mC@rs@center \centering \fi%
@@ -773,6 +780,14 @@
\label{\mC@rs@currentlabel}%
\fi
\endrxnfloat%
+ \let\arrow\relax%
+ \let\reactant\relax%
+ \let\mesomeric\relax%
+ \let\transition\relax%
+ \let\anywhere\relax%
+ \let\dummy\relax%
+ \let\branch\relax%
+ \let\chemand\relax%
}
% ------------------------------------------------------------------------------------- %
@@ -808,6 +823,14 @@
\mC@rxn@i
}
\def\mC@rxn@i{%
+ \let\arrow\mC@arrow%
+ \let\reactant\mC@reactant%
+ \let\mesomeric\mC@mesomeric%
+ \let\transition\mC@transition%
+ \let\anywhere\mC@anywhere%
+ \let\dummy\mC@dummy%
+ \let\branch\mC@branch%
+ \let\chemand\mC@chemand%
\hspace*{0pt}%
\ifx\mC@reaction@align\mC@reaction@center%
\center%
@@ -834,6 +857,15 @@
\ifx\mC@reaction@align\mC@reaction@right%
\endflushright%
\fi
+ \let\arrow\relax%
+ \let\arrow\relax%
+ \let\reactant\relax%
+ \let\mesomeric\relax%
+ \let\transition\relax%
+ \let\anywhere\relax%
+ \let\dummy\relax%
+ \let\branch\relax%
+ \let\chemand\relax%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -841,11 +873,11 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Standardreaktand -------------------------------------------------------------------- %
% \reactant[<pos>,<name>,<tikz>]{<something>}
-\def\reactant{\@ifnextchar[{\reactant@ii}{\reactant@i}}
-\def\reactant@i#1{
+\def\mC@reactant{\@ifnextchar[{\mC@reactant@ii}{\mC@reactant@i}}
+\def\mC@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{
+\def\mC@reactant@ii[#1]#2{
\let\mC@remainargs\@empty\mC@splitarg{#1}
\ifx\@empty\mC@firstarg% erste Option: <pos>, zweite Option: <name>, dritte Option: <tikz>
\def\mC@angle{0}
@@ -858,15 +890,14 @@
\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 --------------------------------------------------------------------------- %
% \mesomeric[<pos>,<name>,<tikz>]{<something>}
-\def\mesomeric{\@ifnextchar[{\mesomeric@ii}{\mesomeric@i}}
-\def\mesomeric@i#1{
+\def\mC@mesomeric{\@ifnextchar[{\mC@mesomeric@ii}{\mC@mesomeric@i}}
+\def\mC@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{
+\def\mC@mesomeric@ii[#1]#2{
\let\mC@remainargs\@empty\mC@splitarg{#1}
\ifx\@empty\mC@firstarg% erste Option: <pos>, zweite Option: <name>, dritte Option: <tikz>
\def\mC@angle{0}
@@ -888,7 +919,7 @@
% Anywhere ---------------------------------------------------------------------------- %
% \anywhere{<pos>,<name>,<tikz>}{<something>}
-\def\anywhere#1#2{
+\def\mC@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}
@@ -910,18 +941,18 @@
% Dummy ------------------------------------------------------------------------------- %
% \dummy[<name>]
-\def\dummy{\@ifnextchar[{\mC@dummy@i}{\mC@dummy@ii}}
+\def\mC@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 ------------------------------------------------------------------- %
% \transition[<pos>,<name>,<tikz>]{<something>}
-\def\transition{\@ifnextchar[{\transition@ii}{\transition@i}}
-\def\transition@i#1{
+\def\mC@transition{\@ifnextchar[{\mC@transition@ii}{\mC@transition@i}}
+\def\mC@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{
+\def\mC@transition@ii[#1]#2{
\let\mC@remainargs\@empty\mC@splitarg{#1}
\ifx\@empty\mC@firstarg% erste Option: <pos>
\def\mC@angle{0}
@@ -973,21 +1004,20 @@
\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 ------------------------------------------------------- %
-\def\elmove{\@ifnextchar[{\mC@elmove@i}{\mC@elmove@ii}}
+\def\mC@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);}}
+\let\elmove\mC@elmove
% 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 ------------------------------------------------------------------- %