diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/chemmacros/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/chemmacros/chemmacros-codehelper.tex | 58 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.pdf | bin | 700294 -> 711291 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.tex | 313 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.pdf | bin | 688962 -> 699196 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.tex | 315 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/chemmacros/chemformula.sty | 618 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty | 404 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty | 47 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def | 2 |
10 files changed, 1075 insertions, 686 deletions
diff --git a/Master/texmf-dist/doc/latex/chemmacros/README b/Master/texmf-dist/doc/latex/chemmacros/README index 62abfad050f..121b57a0559 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/README +++ b/Master/texmf-dist/doc/latex/chemmacros/README @@ -1,10 +1,10 @@ -------------------------------------------------------------------------- -the CHEMMACROS bundle v3.0d +the CHEMMACROS bundle v3.1 -> chemmacros package -> macros and commands for chemists -> chemformula package -> typeset chemical compounds and reactions -> ghsystem package -> typeset H & P statements and pictograms from the globally harmonised system (GHS) -2012/02/10 +2012/02/19 -------------------------------------------------------------------------- This bundle succeeds the chemmacros package which is now part of the bundle diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-codehelper.tex b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-codehelper.tex index de6120d8a49..1cc6589bef9 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-codehelper.tex +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-codehelper.tex @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/02/10 - % +% - 2012/02/19 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -53,6 +53,8 @@ \colorlet{module}{myred} \makeatletter +\newcommand*\bspmidlength[2]{% + \@namedef{beispiel@#1@midlength}{#2}} \lst@RequireAspects{writefile} \newsavebox{\beispiel@box} @@ -113,15 +115,21 @@ CNMR, color, cstsetup, - DeclareInstance, - DeclareSIUnit, + D, + DeclareChemArrow, + DeclareChemIUPAC, DeclareChemParticle, DeclareChemPhase, + DeclareChemReaction, + DeclareChemState, + DeclareInstance, + DeclareSIUnit, definecolor, delm, delp, Delta, Dfi, + draw, E, el, ElPot, @@ -140,6 +148,7 @@ Gibbs, glqq, grqq, + hapto, HNMR, Helmholtz, hertz, @@ -154,6 +163,7 @@ Kb, kilo, Kw, + L, latin, lewis, Lewis, @@ -161,7 +171,7 @@ listofreactions, lqd, mch, - mega + mega, meta, mhName, midrule, @@ -169,7 +179,6 @@ mmHg, mole, newman, - newreaction, NMR, Nu, Nuc, @@ -195,21 +204,25 @@ Pot, prt, R, + Rad, redox, + RenewChemArrow, + RenewChemIUPAC, RenewChemParticle, RenewChemPhase, + RenewChemState, renewtagform, - renewstate, rightarrow, + S, sample, scriptscriptstyle, scrm, scrp, setatomsep, setbondoffset, - setnewstate, sfrac, shorthandoff, + ShowChemArrow, si, SI, sisetup, @@ -224,6 +237,7 @@ toprule, trans, upbeta, + upeta, upgamma, volt, vphantom, @@ -274,6 +288,7 @@ \end{shaded} } +\bspmidlength{below}{3mm} \beispiel@new{below} {% \setbox\beispiel@box=\hbox\bgroup @@ -288,13 +303,14 @@ \begin{minipage}{.9\linewidth} \hbox to \linewidth{\box\beispiel@box\hss}% \end{minipage} - \vskip3mm + \expandafter\vskip\beispiel@below@midlength \begin{minipage}{.9\linewidth} \beispiel@input \end{minipage} \end{shaded} } +\bspmidlength{ox}{7mm} \beispiel@new{ox} {% \setbox\beispiel@box=\hbox\bgroup @@ -309,11 +325,11 @@ \begin{minipage}{.9\linewidth} \hbox to \linewidth{\box\beispiel@box\hss}% \end{minipage} - \vskip1.5cm + \expandafter\vskip\beispiel@ox@midlength \begin{minipage}{.9\linewidth} \beispiel@input - \vskip1cm \end{minipage} + \vskip7mm \end{shaded} } @@ -370,15 +386,21 @@ CNMR, color, cstsetup, - DeclareInstance, - DeclareSIUnit, + D, + DeclareChemArrow, + DeclareChemIUPAC, DeclareChemParticle, DeclareChemPhase, + DeclareChemReaction, + DeclareChemState, + DeclareInstance, + DeclareSIUnit, definecolor, delm, delp, Delta, Dfi, + draw, E, el, ElPot, @@ -397,6 +419,7 @@ Gibbs, glqq, grqq, + hapto, HNMR, Helmholtz, hertz, @@ -411,6 +434,7 @@ Kb, kilo, Kw, + L, latin, lewis, Lewis, @@ -426,7 +450,6 @@ mmHg, mole, newman, - newreaction, NMR, Nu, Nuc, @@ -452,12 +475,17 @@ Pot, prt, R, + Rad, redox, + RenewChemArrow, + RenewChemIUPAC, RenewChemParticle, RenewChemPhase, + RenewChemState, renewtagform, renewstate, rightarrow, + S, sample, scriptscriptstyle, scrm, @@ -467,6 +495,7 @@ setnewstate, sfrac, shorthandoff, + ShowChemArrow, si, SI, sisetup, @@ -481,6 +510,7 @@ toprule, trans, upbeta, + upeta, upgamma, volt, vphantom, @@ -578,7 +608,7 @@ { \texttt{\textcolor{code}{\textbackslash begin}\{#2\}} \IfNoValueF { #1 } { \texttt { [ #2 ] } } - \tl_use:N \c_space_tl #3 ~ + \tl_use:N \c_space_tl \texttt { #3 } ~ \texttt{\textcolor{code}{\textbackslash end}\{#2\}} \index { #2 @ \texttt { #2 } ~ ( env. ) } } diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.pdf Binary files differindex 26ba8c843ba..54a09c1da8e 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.pdf +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.pdf diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.tex b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.tex index 947468eee49..2948742390e 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.tex +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_de.tex @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/02/10 - % +% - 2012/02/19 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -64,7 +64,7 @@ \addbibresource{\jobname.bib} \begin{filecontents}{\jobname.bib} @book{iupac:greenbook, - author = {E. Richard Cohan and Tomislav Cvita\v{s} and Jeremy G. Frey and Bertil Holmström and kozo Kuchitsu and Roberto Marquardt and Ian Mills and Franco Pavese and Martin Quack and Jürgan Stohner and Herbert L. Strauss and Michio Takami and Anders J Thor}, + author = {E. Richard Cohan and Tomislav Cvita\v{s} and Jeremy G. Frey and Bertil Holmström and Kozo Kuchitsu and Roberto Marquardt and Ian Mills and Franco Pavese and Martin Quack and Jürgan Stohner and Herbert L. Strauss and Michio Takami and Anders J Thor}, title = {“Quantities, Symbols and Units in Physical Chemistry”, IUPAC Green Book}, edition = {3rd Edition. 2nd Printing}, year = {2008}, @@ -162,12 +162,14 @@ Die Paketoption \key{bpchem} (Abschnitt \ref{sec:optionen}) benötigt \paket{bpc \chemmacros wurde mit den neuen Paketen \chemformula und \ghsystem gebündelt. \chemformula ist eine Alternative zu \paket{mhchem}. Das führte zu einigen internen Änderungen bei \chemmacros. Gleichzeitig wurde die Dokumentation komplett überarbeitet. -Vielleicht erinnern Sie Sich, dass \chemmacros' Optionen alle verschiedenen Modulen angehören, siehe Abschnitt \ref{sec:setup} für weitere Informationen. Sie werden in den linken Rand geschrieben, wenn die Option das erste Mal erwähnt wird. Abschnitt \ref{sec:overview} listet alle von \chemmacros' Optionen und ihre Module auf. In diesem Dokument werden Optionen \textcolor{key}{\texttt{grün}} und Module \textcolor{module}{\texttt{rot}} dargestellt. +Vielleicht erinnern Sie Sich, dass \chemmacros' Optionen alle verschiedenen Modulen angehören, siehe Abschnitt \ref{sec:setup} für weitere Informationen. Sie werden in den linken Rand geschrieben, wenn die Option das erste Mal erwähnt wird. Abschnitt \ref{sec:overview} listet alle Optionen von \chemmacros und ihre Module auf. In diesem Dokument werden Optionen \textcolor{key}{\texttt{grün}} und Module \textcolor{module}{\texttt{rot}} dargestellt. \chemformula verwendet die Pakete \chemmacros und \paket{nicefrac}. \chemformula hat keine eigenen Paketoptionen sondern leitet alle weiter an \chemmacros. \ghsystem verwendet die Pakete \chemmacros, \paket{tabu}, \paket{longtable}, \paket{ifpdf} und \paket{graphicx}. \ghsystem hat keine eigenen Paketoptionen sondern leitet alle weiter an \chemmacros. +\achtung{Es gibt einige veraltete Befehle und Optionen, die in dieser Dokumentation nicht mehr beschrieben werden. Um Kompatibilität mit älteren Dokumenten zu gewährleisten, sind sie immer noch definiert. Diese Befehle geben eine Warnung aus. In Zukunft könnten sie nicht mehr definiert sein.} + \section{Motivation und Hintergrund} \chemmacros entstand vor einigen Jahren als wachsende Liste von Makros, die ich häufig verwendete. Ich kann mich nicht mehr genau erinnern, wann und warum ich entschied, sie als Paket zu veröffentlichen. Nun \textendash\ hier ist es und ich hoffe, Sie werden das eine oder andere ebenfalls nützlich finden. @@ -213,9 +215,9 @@ Sowohl \chemformula als auch \ghsystem haben keine eigenen Paketoptionen. Wenn S \item \key[option]{circled}{\uline{formal}/all/none} \chemmacros unterscheidet zwischen zwei Typen von Ladungen\footnote{Vielen Dank an Christoph Schäfer, der mich darauf aufmerksam machte, dass v1.1 die Ladungen zu nachlässig behandelte!}: reale ($+/-$) und formale (\fplus/\fminus) Ladungen. Die Option \texttt{formal} unterscheidet zwischen ihnen, \texttt{none} stellt alle ohne Umkreisung dar, \texttt{all} umkreist alle. Default = \texttt{formal} \item \key[option]{circletype}{\uline{chem}/math} Diese Option schaltet zwischen zwei Darstellungsmöglichkeiten für formale Ladungen hin und her: \cmd{fplus} \fplus\ und \lstinline+$\oplus$+ $\oplus$. Default = \texttt{chem} \item \key[option]{detect-bold}{\uline{true}/false} Diese Option bestimmt, ob Makros wie \cmd{pKa} eine fette Schriftserie erkennen. \textbf{fetter \pKa Text} vs.\ {\chemsetup[option]{detect-bold}\textbf{fetter \pKa Text}}. Default = \texttt{false} - \item \key[option]{EZ}{\uline{chemmacros}/cool} Der Befehl \cmd{E} wird durch das Paket \paket{cool} ebenfalls definiert. Mit dieser Option können Sie wählen, welche Definition verwendet wird, siehe Seite \pageref{EZ}. Default = \texttt{chemmacros}. Diese Option kann nur in der Präambel gesetzt werden. \item \key[option]{german}{\uline{true}/false} Diese Option ändert die Befehle \cmd{pKa}, \cmd{sld} und \cmd{lqd}. Default = \texttt{false}. Diese Option hat den Alias \key[option]{ngerman}. \item \key[option]{ghs}{\uline{true}/false} Das Paket \ghsystem abschalten. Die Einstellung \key{ghs}{false} wird das Laden von \ghsystem unterbinden. Default = \texttt{true} + \item \key[option]{iupac}{auto/restricted/strict} Einstellen, wie die Nomenklatur-Befehle definiert werden. Siehe Seite \pageref{key:iupac}. Default = \texttt{auto} \item \key[option]{method}{\uline{chemformula}/mhchem} Sie können wählen, ob \chemmacros \paket{mhchem} oder \chemformula für die Reaktionsumgebungen (siehe Abschnitt \ref{ssec:mhchem_reaktionen}) und die Teilchen (siehe Abschnitt \ref{sec:teilchen}) verwendet. Default = \texttt{chemformula}. Diese Option kann nur in der Präambel gesetzt werden. \item \key[option]{Nu}{\uline{chemmacros}/mathspec} Das Paket \paket{mathspec} definiert ebenfalls ein Makro \cmd{Nu}. Diese Option entscheidet, welche Definition gilt, siehe Seite \pageref{Nu}. Default = \texttt{chemmacros}. Diese Option kann nur in der Präambel gesetzt werden. \item \key[option]{strict}{\uline{true}/false} Die Einstellung \key{strict}{true} wird alle Warnungen in Fehlermeldungen ändern. Default = \texttt{false} @@ -270,10 +272,10 @@ Einige einfache Makros, um häufig verwendete Teilchen darzustellen. Außerdem e Ein weiterer Befehl erlaubt das Setzen von Radikalen mit Ladungen und Tiefstellungen. \begin{description} - \item \cmd{R}[<sign>]{<subscript>} + \item \cmd{Rad}[<sign>]{<subscript>} \end{description} \begin{beispiel} - \R[+]{tert} \R[-]{sek} \R{prim} + \Rad[+]{tert} \Rad[-]{sek} \Rad{prim} \end{beispiel} Die beiden Teilchen \cmd{Nu} und \cmd{ba} können angepasst werden. Dafür verwenden Sie die Option @@ -319,31 +321,53 @@ Abhängig von der \key{method}, die Sie als Option gewählt haben, wird die \tex \end{beispiel} Der Befehl \cmd{iupac} ist dennoch mehr ein semantischer Befehl. Meistens kann man (beinahe) dasselbe erreichen, indem man \cmd{-} anstelle von \cmd{\textbar} verwendet, \texttt{-} anstelle von \cmd{-} und \lstinline=\textsuperscript= anstelle von \cmd{\textasciicircum}. -\subsection{Stereodeskriptoren und Nomenklatur}\secidx{Stereodeskriptoren und Nomenklatur} -Die Makros dieses Abschnitts sollen das Schreiben von IUPAC-Namen vereinfachen. +Der Befehl \cmd{iupac} dient noch einem anderen Zweck. Unabhängig von der Paketoption \key[option]{iupac} sind alle Befehle, die in diesem Abschnitt vorgestellt werden, \emph{innerhalb} von \cmd{iupac} immer definiert. Eine ganze Reihe der Nomenklatur-Befehle haben sehr allgemeine Namen: \cmd{meta}, \cmd{D}, \cmd{E}, \cmd{L}, \cmd{R}, \cmd{S}, \cmd{trans} und so weiter. Das bedeutet, dass sie entweder schon definiert sind (\cmd{L} \L) oder leicht von anderen Paketen oder Klassen definiert werden (das Paket \paket{cool} definiert zum Beispiel sowohl \cmd{D} als auch \cmd{E}). Um Ihnen Kontrolle darüber zu geben, welche Befehle wie definiert sind, gibt es die Paketoption \key[option]{iupac}\label{key:iupac}. Sie hat drei Modi: +\begin{itemize} + \item \key{iupac}{auto}: wenn der Befehl \emph{nicht} von einem Paket oder einer Klasse, die sie verwenden, definiert wird, ist er generell verfügbar, sonst nur \emph{innerhalb} von \cmd{iupac}. + \item \key{iupac}{restricted}: alle Nomenklatur-Befehle sind \emph{nur} innerhalb von \cmd{iupac} definiert. Wenn sie von einem anderen Paket definiert sind, sind sie natürlich außerhalb verfügbar. Ansonsten sind sie außerhalb nicht definiert. + \item \key{iupac}{strict}: \chemmacros überschreibt jede bestehende Definition und macht die Befehle im ganzen Dokument verfügbar. Sie können natürlich (nur nach \lstinline=\begin{document}= umdefiniert werden. Sie behalten dann die Nomenklatur-Bedeutung innerhalb von \cmd{iupac}. +\end{itemize} +\ref{tab:iupac_modes} demonstriert die verschiedenen Modi. + +\begin{table}[h] + \centering + \begin{tabular}{lccc}\toprule + & auto & restricted & strict \\\midrule + \lstinline=\L= & \L & \L & \iupac{\L} \\ + \lstinline=\iupac{\L}= & \iupac{\L} & \iupac{\L} & \iupac{\L} \\ + \lstinline=\D= & \D & -- & \D \\ + \lstinline=\iupac{\D}= & \iupac{\D} & \iupac{\D} & \iupac{\D} \\\bottomrule + \end{tabular} + \caption{Demonstration der verschiedenen \protect\key{iupac}-Modi.}\label{tab:iupac_modes} +\end{table} + +\subsubsection{Vordefinierte Befehle}\secidx[vordefiniert]{IUPAC-Namen}\secidx{Stereodeskriptoren und Nomenklatur} \paragraph{Cahn-Ingold-Prelog}\index{Cahn-Ingold-Prelog}\secidx[Cahn-Ingold-Prelog]{IUPAC-Namen} \begin{description} - \item \cmd{Rcip} \Rcip - \item \cmd{Scip} \Scip \item \cmd{cip}{<conf>} \zB: \cmd{cip}{R,S} \cip{R,S} + \item \cmd{R} \iupac{\R} + \item \cmd{S} \iupac{\S} \end{description} +Da der Befehl \cmd{S} schon eine andere Bedeutung hat (\S), ist er in der Voreinstellung nur innerhalb \cmd{iupac} verfügbar. \paragraph{Fischer}\index{Fischer}\secidx[Fischer]{IUPAC-Namen} \begin{description} - \item \cmd{Dfi} \Dfi - \item \cmd{Lfi} \Lfi + \item \cmd{D} \iupac{\D} + \item \cmd{L} \iupac{\L} \end{description} +Da der Befehl \cmd{L} schon eine andere Bedeutung hat (\L), ist er in der Voreinstellung nur innerhalb \cmd{iupac} verfügbar. -\paragraph{cis/trans, zusammen/entgegen, syn/anti \& tert}\index{tert}\secidx[tert]{IUPAC-Namen}\index{cis/trans}\secidx[cis/trans]{IUPAC-Namen}\index{zusammen/entgegen}\secidx[zusammen/entgegen]{IUPAC-Namen}\secidx[syn/anti]{IUPAC Names} Bitte beachten Sie, dass die Befehle \cmd{cis} und \cmd{trans} auch von \paket{bpchem} definiert werden. Wenn Sie das Paket laden, werden sie von \chemmacros überschrieben. Bei \paket{bpchem} haben sie \textit{immer} ein \lstinline+\xspace+ angehängt, bei \chemmacros \textit{nie}. +\paragraph{cis/trans, zusammen/entgegen, syn/anti \& tert}\index{tert}\secidx[tert]{IUPAC-Namen}\index{cis/trans}\secidx[cis/trans]{IUPAC-Namen}\index{zusammen/entgegen}\secidx[zusammen/entgegen]{IUPAC-Namen}\secidx[syn/anti]{IUPAC Names} \begin{description} \item \cmd{cis} \cis \item \cmd{trans} \trans - \item \cmd{Z} \Z\label{EZ} - \item \cmd{E} \E\ (\cmd{E} wird auch durch das Paket \paket{cool} definiert. Durch Verwenden der Paketoption \key{EZ}{cool} werden anstelle von \cmd{E} und \cmd{Z} durch \chemmacros \cmd{Ent} und \cmd{Zus} bereitgestellt.) + \item \cmd{Z} \Z + \item \cmd{E} \E \item \cmd{syn} \syn \item \cmd{anti} \anti \item \cmd{tert} \tert \end{description} +Das Paket \paket{cool} definiert die Befehle \cmd{E} und \cmd{D} ebenfalls. Wenn Sie es laden, ist die \chemmacros-Version in der Voreinstellung nur innerhalb von \cmd{iupac} verfügbar. \paragraph{ortho/meta/para}\index{ortho/meta/para}\secidx[ortho/meta/para]{IUPAC-Namen} \begin{description} @@ -360,9 +384,9 @@ Die Makros dieses Abschnitts sollen das Schreiben von IUPAC-Namen vereinfachen. Beispiele: \begin{beispiel} - \iupac{\Dfi\-Wein\|s\"aure} = \\ + \iupac{\D\-Wein\|s\"aure} = \\ \iupac{\cip{2S,3S}\-Wein\|s\"aure} \\ - \iupac{\Dfi\-($-$)\-Threose} = \\ + \iupac{\D\-($-$)\-Threose} = \\ \iupac{\cip{2S,3R}\-($-$)\-2,3,4\-Tri\|hydroxy\|butanal} \\ \iupac{\cis\-2\-Butene} = \\ \iupac{\Z\-2\-Butene}, \\ @@ -370,7 +394,28 @@ Beispiele: \iupac{\meta\-Xylol} = \\ \iupac{1,3\-Di\|methyl\|benzene} \end{beispiel} -\secidx*{IUPAC-Namen}\secidx*{Stereodeskriptoren und Nomenklatur} +\secidx*{Stereodeskriptoren und Nomenklatur} + +\subsubsection{Eigene Nomenklatur-Befehle}\secidx[eigene]{IUPAC-Namen} +Wenn Ihnen Befehle fehlen sollten, können Sie neue definieren. +\begin{description} + \item \cmd{DeclareChemIUPAC}{<cmd>}\ma{<declaration>} + \item \cmd{RenewChemIUPAC}{<cmd>}\ma{<declaration>} +\end{description} +Ein Befehl, der in dieser Weise definiert wurde, gehorcht der Option \key[option]{iupac}. Das bedeutet, dass bestehende Befehle nur überschieben werden, wenn Sie die Paketoption \key{iupac}{strict} verwenden. \cmd{DeclareChemIUPAC} wird jedochdie Definition eines bestehenden Nomenklatur-Befehls \emph{nicht} überschreiben, sondern eine Warnung/einen Fehler melden (abhängig von der Paketoption \key{strict}). +\begin{beispiel} + % uses the `upgreek' package + \DeclareChemIUPAC\hapto{$\upeta$} + Ferrocen = \iupac{Bis(\hapto\^5\-cyclo\|penta\|dienyl)eisen} +\end{beispiel} + +\cmd{RenewChemIUPAC} erlaubt Ihnen, die vordefinierten Befehle umzudefinieren. +\begin{beispiel} + \iupac{\meta\-Xylol} \\ + \RenewChemIUPAC\meta{\textit{m}} + \iupac{\meta\-Xylol} +\end{beispiel} +\secidx*{IUPAC-Namen} \subsection{Lateinische Ausdrücke}\secidx{Lateinische Ausdrücke}[Lateinische Ausdruecke] Zuletzt gibt es diese beiden Makros für lateinische Ausdrücke: @@ -458,7 +503,7 @@ Es gibt eine Option, die das Verhalten der Ladungen beeinflusst: Das hat folgende Auswirkungen: \begin{beispiel} - \chemsetup[charges]{append=false} + \chemsetup{charges/append=false,phases/pos=sub} \ce{H\pch\aq} \ce{H\aq\pch} \chemsetup[charges]{append=true} @@ -467,7 +512,7 @@ Das hat folgende Auswirkungen: In den meisten Fällen wird das Verhalten unerwünscht sein, es kann jedoch Gelegenheiten geben, wo es nützlich sein kann: \begin{beispiel} - \chemsetup[charges]{append=false} + \chemsetup{charges/append=false,phases/pos=sub} \ce{\ox{1,H}\pch\aq} \chemsetup[charges]{append=true} @@ -638,22 +683,28 @@ den Abstand zwischen Atom und Anfang der Linie zu verändern. Beispiele: \begin{beispiel}[ox] - \ch{ 2 "\OX{o1,Na}" + "\OX{r1,Cl}" {}2 -> 2 "\OX{o2,Na}" \pch{} + 2 "\OX{r2,Cl}" \mch } + \ch{ 2 "\OX{o1,Na}" + "\OX{r1,Cl}" {}2 -> 2 "\OX{o2,Na}" \pch{} + 2 +"\OX{r2,Cl}" \mch } \redox(o1,o2){\small OX: $- 2\el$} \redox(r1,r2)[][-1]{\small RED: $+ 2\el$} \end{beispiel} \begin{beispiel}[ox] - \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" \pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } + \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" +\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } \redox(o1,o2){\small OX: $- 2\el$} \redox(r1,r2)[][-1]{\small RED: $+ 2\el$} \end{beispiel} +\bspmidlength{ox}{15mm} \begin{beispiel}[ox] - \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" \pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } + \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" +\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } \redox(o1,o2)[draw=red,->][3.33]{\small OX: $- 2\el$} \redox(r1,r2)[draw=blue,->]{\small RED: $+ 2\el$} \end{beispiel} -\begin{beispiel}[ox] - \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" \pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } +\bspmidlength{ox}{7mm} + \begin{beispiel}[ox] + \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" +\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } \redox(o1,o2)[green,-stealth]{\small OX} \redox(r1,r2)[purple,-stealth][-1]{\small RED} \end{beispiel} @@ -701,12 +752,12 @@ Die Zahl und die Einheit werden entsprechend der Regeln für \paket{siunitx} ges \subsubsection{Neue Größen definieren} Mit dem Befehl \begin{description} - \item \cmd{setnewstate}[<keyval>]{<name>}{<symbol>}\ma{<unit>} + \item \cmd{DeclareChemState}[<keyval>]{<name>}{<symbol>}\ma{<unit>} \end{description} können neue Größen definiert werden. \begin{beispiel} - \setnewstate{Helmholtz}{A}{\kilo\joule\per\mole} - \setnewstate[subscript-left=false,exponent=]{ElPot}{E}{\volt} + \DeclareChemState{Helmholtz}{A}{\kilo\joule\per\mole} + \DeclareChemState[subscript-left=false,exponent=]{ElPot}{E}{\volt} \Helmholtz{123.4} \\ \ElPot{-1.1} \\ \ElPot[exponent=0]($\ch{Sn}|\ch{Sn^2+}||\ch{Pb^2+}|\ch{Pb}$){0.01} @@ -723,20 +774,20 @@ Dieser Befehl hat fast die gleichen Optionen, wie die Größen selbst, mit denen \subsubsection{Größen umdefinieren} Mit \begin{description} - \item \cmd{renewstate}[<keyval>]{<name>}{<symbol>}\ma{<unit>} + \item \cmd{RenewChemState}[<keyval>]{<name>}{<symbol>}\ma{<unit>} \end{description} kann man bestehende Größen umdefinieren: \begin{beispiel} - \renewstate{Enthalpy}{h}{\joule} + \RenewChemState{Enthalpy}{h}{\joule} \Enthalpy(f){12.5} \end{beispiel} Der Befehl ist analog zu \cmd{setnewstate}, \dh er hat dieselben Optionen. Man könnte also \textendash\ um thermodynamischen Konventionen zu folgen \textendash\ eine molare und eine absolute Größe definieren: \begin{beispiel} - \setnewstate[exponent=]{enthalpy}{h}{\kilo\joule\per\mole}% molar - \renewstate[exponent=]{Enthalpy}{H}{\kilo\joule}% absolute + \DeclareChemState[exponent=]{enthalpy}{h}{\kilo\joule\per\mole}% molar + \RenewChemState[exponent=]{Enthalpy}{H}{\kilo\joule}% absolute \enthalpy{-12.3} \Enthalpy{-12.3} \end{beispiel} @@ -900,7 +951,7 @@ Wenn Sie das Layout der Zähler-Tags ändern wollen, verwenden Sie \subsection{Eigene Reaktionen} Sie können mit dem Befehl \begin{description} - \item \cmd{newreaction}[<keyval>]{<name>}\ma{<math name>} + \item \cmd{DeclareChemReaction}[<keyval>]{<name>}\ma{<math name>} \end{description} weitere Reaktionsumgebungen erstellen. @@ -917,19 +968,19 @@ Dann gibt es \key*{arg}, die verwendet wird, um eine Umgebung mit einem obligato Die vordefinierten Umgebungen wurden durch \begin{description} - \item \cmd{newreaction}[star]{reaction}\ma{equation} und - \item \cmd{reaction}[star]{reactions}\ma{align}. + \item \cmd{DeclareChemReaction}[star]{reaction}\ma{equation} und + \item \cmd{DeclareChemReaction}[star]{reactions}\ma{align}. \end{description} definiert. Nehmen wir an, Sie wollen eine Umgebung mit dem Verhalten der \texttt{alignat} Umgebung für \chemformula-/\paket{mhchem}-Reaktionen. Sie könnten folgendes tun: \begin{beispiel}[code only] - \newreaction[star,arg]{reactionsat}{alignat} + \DeclareChemReaction[star,arg]{reactionsat}{alignat} \end{beispiel} Damit ist die \texttt{reactionsat}-Umgebung definiert. \begin{beispiel} - \newreaction[star,arg]{reactionsat}{alignat} + \DeclareChemReaction[star,arg]{reactionsat}{alignat} \begin{reactionsat}{3} A &-> B &&-> C &&-> D \\ aaaaa &-> bbbbb &&-> ccccc &&-> ddddd @@ -1163,76 +1214,76 @@ Manche Optionen können ohne Wert verwendet werden. Dann wird der \uline{unterst \bottomrule \endfoot \multicolumn{5}{l}{Paketoptionen:} \\ - bpchem & option & \uline{true}/false & false & Seite \pageref{key:option_bpchem} \\ - circled & option & \uline{formal}/all/none & formal & Seite \pageref{key:option_circled} \\ - circletype & option & \uline{chem}/math & chem & Seite \pageref{key:option_circletype} \\ - detect-bold & option & \uline{true}/false & false & Seite \pageref{key:option_detect-bold} \\ - EZ & option & \uline{chemmacros}/cool & chemmacros & Seite \pageref{key:option_EZ} \\ - german & option & \uline{true}/false & false & Seite \pageref{key:option_german} \\ - ghs & option & \uline{true}/false & true & Seite \pageref{key:option_ghs} \\ - method & option & \uline{chemformula}/formula & formula & Seite \pageref{key:option_method} \\ - Nu & option & \uline{chemmacros}/mathspec & chemmacros & Seite \pageref{key:option_Nu} \\ - strict & option & \uline{true}/false & false & Seite \pageref{key:option_strict} \\ - synchronize & option & \uline{true}/false & false & Seite \pageref{key:option_synchronize} \\ - version & option & 1/2 & 2 & Seite \pageref{key:option_version} \\ - xspace & option & \uline{true}/false & true & Seite \pageref{key:option_xspace} \\ + bpchem & option & \uline{true}/false & false & Seite \pageref{key:option_bpchem} \\ + circled & option & formal/\uline{all}/none & formal & Seite \pageref{key:option_circled} \\ + circletype & option & chem/math & chem & Seite \pageref{key:option_circletype} \\ + detect-bold & option & \uline{true}/false & false & Seite \pageref{key:option_detect-bold} \\ + german & option & \uline{true}/false & false & Seite \pageref{key:option_german} \\ + ghs & option & \uline{true}/false & true & Seite \pageref{key:option_ghs} \\ + iupac & option & auto/restricted/strict & auto & Seite \pageref{key:option_iupac} \\ + method & option & chemformula/formula & formula & Seite \pageref{key:option_method} \\ + Nu & option & chemmacros/mathspec & chemmacros & Seite \pageref{key:option_Nu} \\ + strict & option & \uline{true}/false & false & Seite \pageref{key:option_strict} \\ + synchronize & option & \uline{true}/false & false & Seite \pageref{key:option_synchronize} \\ + version & option & 1/2/bundle & bundle & Seite \pageref{key:option_version} \\ + xspace & option & \uline{true}/false & true & Seite \pageref{key:option_xspace} \\ \multicolumn{5}{l}{\cmd{ba}, \cmd{Nu}:} \\ - elpair & particle & \uline{dots}/dash/false & false & Seite \pageref{key:particle_elpair} \\ + elpair & particle & \uline{dots}/dash/false & false & Seite \pageref{key:particle_elpair} \\ \multicolumn{5}{l}{\cmd{pch}, \cmd{mch}, \cmd{fpch}, \cmd{fmch}:} \\ - append & charges & \uline{true}/false & false & Seite \pageref{key:charges_append} \\ + append & charges & \uline{true}/false & false & Seite \pageref{key:charges_append} \\ \multicolumn{5}{l}{\cmd{ox}:} \\ - parse & ox & \uline{true}/false & true & Seite \pageref{key:ox_parse} \\ - roman & ox & \uline{true}/false & true & Seite \pageref{key:ox_roman} \\ - pos & ox & top/super/side & top & Seite \pageref{key:ox_pos} \\ - explicit-sign & ox & \uline{true}/false & false & Seite \pageref{key:ox_explicit-sign} \\ - decimal-marker & ox & comma/point & point & Seite \pageref{key:ox_decimal-marker} \\ + parse & ox & \uline{true}/false & true & Seite \pageref{key:ox_parse} \\ + roman & ox & \uline{true}/false & true & Seite \pageref{key:ox_roman} \\ + pos & ox & top/super/side & top & Seite \pageref{key:ox_pos} \\ + explicit-sign & ox & \uline{true}/false & false & Seite \pageref{key:ox_explicit-sign} \\ + decimal-marker & ox & comma/point & point & Seite \pageref{key:ox_decimal-marker} \\ \multicolumn{5}{l}{\cmd{OX}, \cmd{redox}:} \\ - dist & redox & <dim> & .6em & Seite \pageref{key:redox_dist} \\ - sep & redox & <dim> & .2em & Seite \pageref{key:redox_sep} \\ + dist & redox & <dim> & .6em & Seite \pageref{key:redox_dist} \\ + sep & redox & <dim> & .2em & Seite \pageref{key:redox_sep} \\ \multicolumn{5}{l}{\cmd{Enthalpy}, \cmd{Entropy}, \cmd{Gibbs}:} \\ - exponent & & <anything> & \cmd{standardstate} & Seite \pageref{key:none_exponent} \\ - delta & & <anything>/false & & Seite \pageref{key:none_delta} \\ - subscript & & left/right & & Seite \pageref{key:none_subscript} \\ - unit & & <unit> & & Seite \pageref{key:none_unit} \\ - \multicolumn{5}{l}{\cmd{setnewstate}, \cmd{renewstate}:} \\ - exponent & & <anything> & \cmd{standardstate} & Seite \pageref{key:none_exponent} \\ - delta & & <anything>/false & & Seite \pageref{key:none_delta} \\ - subscript & & <anything> & & Seite \pageref{key:none_subscript} \\ - subscript-left & & true/false & & Seite \pageref{key:none_subscript-left} \\ + exponent & & <anything> & \cmd{standardstate} & Seite \pageref{key:none_exponent} \\ + delta & & <anything>/false & & Seite \pageref{key:none_delta} \\ + subscript & & left/right & & Seite \pageref{key:none_subscript} \\ + unit & & <unit> & & Seite \pageref{key:none_unit} \\ + \multicolumn{5}{l}{\cmd{DeclareChemState}, \cmd{RenewChemState}:} \\ + exponent & & <anything> & \cmd{standardstate} & Seite \pageref{key:none_exponent} \\ + delta & & <anything>/false & & Seite \pageref{key:none_delta} \\ + subscript & & <anything> & & Seite \pageref{key:none_subscript} \\ + subscript-left & & \uline{true}/false & & Seite \pageref{key:none_subscript-left} \\ \multicolumn{5}{l}{\cmd{State}:} \\ - exponent & state & <anything> & \cmd{standardstate} & Seite \pageref{key:state_exponent} \\ - delta & state & <anything>/false & & Seite \pageref{key:state_delta} \\ - subscript-left & state & true/false & & Seite \pageref{key:state_subscript-left} \\ + exponent & state & <anything> & \cmd{standardstate} & Seite \pageref{key:state_exponent} \\ + delta & state & <anything>/false & & Seite \pageref{key:state_delta} \\ + subscript-left & state & \uline{true}/false & & Seite \pageref{key:state_subscript-left} \\ \multicolumn{5}{l}{\cmd{NMR}:} \\ - unit & nmr & <unit> & \cmd{mega}\cmd{hertz} & Seite \pageref{key:nmr_unit} \\ - nucleus & nmr & \{<num>,<atom symbol>\} & \{1,H\} & Seite \pageref{key:nmr_nucleus} \\ - \multicolumn{5}{l}{\cmd{newreaction}:} \\ - star & & \uline{true}/false & false & Seite \pageref{key:none_star} \\ - arg & & \uline{true}/false & false & Seite \pageref{key:none_arg} \\ - list-name & reaction & <anything> & List of reactions & Seite \pageref{key:reaction_list-name} \\ - list-entry & reaction & <anything> & Reaction & Seite \pageref{key:reaction_list-entry} \\ + unit & nmr & <unit> & \cmd{mega}\cmd{hertz} & Seite \pageref{key:nmr_unit} \\ + nucleus & nmr & \{<num>,<atom symbol>\} & \{1,H\} & Seite \pageref{key:nmr_nucleus} \\ + \multicolumn{5}{l}{\cmd{DeclareChemReaction}:} \\ + star & & \uline{true}/false & false & Seite \pageref{key:none_star} \\ + arg & & \uline{true}/false & false & Seite \pageref{key:none_arg} \\ + list-name & reaction & <anything> & List of reactions & Seite \pageref{key:reaction_list-name} \\ + list-entry & reaction & <anything> & Reaction & Seite \pageref{key:reaction_list-entry} \\ \multicolumn{5}{l}{\cmd{mhName}:} \\ - align & mhName & <alignment> & \cmd{centering} & Seite \pageref{key:mhName_align} \\ - format & mhName & <commands> & & Seite \pageref{key:mhName_format} \\ - fontsize & mhName & <fontsize> & \cmd{tiny} & Seite \pageref{key:mhName_fontsize} \\ - width & mhName & <dim> & & Seite \pageref{key:mhName_width} \\ - \multicolumn{5}{l}{Phasen:} \\ - pos & phases & side/sub & side & Seite \pageref{key:phases_pos} \\ - space & phases & <dim> & .1333em & Seite \pageref{key:phases_space} \\ + align & mhName & <alignment> & \cmd{centering} & Seite \pageref{key:mhName_align} \\ + format & mhName & <commands> & & Seite \pageref{key:mhName_format} \\ + fontsize & mhName & <fontsize> & \cmd{tiny} & Seite \pageref{key:mhName_fontsize} \\ + width & mhName & <dim> & & Seite \pageref{key:mhName_width} \\ + \multicolumn{5}{l}{phases:} \\ + pos & phases & side/sub & side & Seite \pageref{key:phases_pos} \\ + space & phases & <dim> & .1333em & Seite \pageref{key:phases_space} \\ \multicolumn{5}{l}{\cmd{newman}:} \\ - angle & newman & <angle> & 0 & Seite \pageref{key:newman_angle} \\ - scale & newman & <factor> & 1 & Seite \pageref{key:newman_scale} \\ - ring & newman & <tikz> & & Seite \pageref{key:newman_ring} \\ - atoms & newman & <tikz> & & Seite \pageref{key:newman_atoms} \\ - back-atoms & newman & <tikz> & & Seite \pageref{key:newman_back-atoms} \\ + angle & newman & <angle> & 0 & Seite \pageref{key:newman_angle} \\ + scale & newman & <factor> & 1 & Seite \pageref{key:newman_scale} \\ + ring & newman & <tikz> & & Seite \pageref{key:newman_ring} \\ + atoms & newman & <tikz> & & Seite \pageref{key:newman_atoms} \\ + back-atoms & newman & <tikz> & & Seite \pageref{key:newman_back-atoms} \\ \multicolumn{5}{l}{\cmd{orbital} \ttfamily <type> = s/p/sp/sp2/sp3:} \\ - phase & orbital/<type> & \uline{+}/- & + & Seite \pageref{key:orbital_phase} \\ - scale & orbital/<type> & <factor> & 1 & Seite \pageref{key:orbital_scale} \\ - color & orbital/<type> & <color> & black & Seite \pageref{key:orbital_color} \\ - angle & orbital/<type> & <angle> & 90 & Seite \pageref{key:orbital_angle} \\ - half & orbital/p & \uline{true}/false & false & Seite \pageref{key:orbital_half} \\ - overlay & orbital & \uline{true}/false & false & Seite \pageref{key:orbital_overlay} \\ - opacity & ornital & <num> & 1 & Seite \pageref{key:orbital_opacity} + phase & orbital/<type> & +/- & + & Seite \pageref{key:orbital_phase} \\ + scale & orbital/<type> & <factor> & 1 & Seite \pageref{key:orbital_scale} \\ + color & orbital/<type> & <color> & black & Seite \pageref{key:orbital_color} \\ + angle & orbital/<type> & <angle> & 90 & Seite \pageref{key:orbital_angle} \\ + half & orbital/p & \uline{true}/false & false & Seite \pageref{key:orbital_half} \\ + overlay & orbital & \uline{true}/false & false & Seite \pageref{key:orbital_overlay} \\ + opacity & ornital & <num> & 1 & Seite \pageref{key:orbital_opacity} \end{longtable} \normalsize\secidx*{Übersicht über die Optionen (chemmacros)}[Uebersicht ueber die Optionen] \secidx*{CHEMMACROS} @@ -1589,15 +1640,18 @@ Der Leerraum, der nach dem geschützen Mathe-Input ausgegeben wird, kann angepas \section{Pfeile}\label{sec:arrows}\secidx{Pfeile} \subsection{Pfeiltypen}\secidx[Typen]{Pfeile} -Pfeile werden auf die gleiche intuitive Weise eingegeben wie bei \paket{mhchem}. Es gibt sechs verschiedene Typen: +Pfeile werden auf die gleiche intuitive Weise eingegeben wie bei \paket{mhchem}. Es gibt eine Reihe verschiedener Typen: \begin{description} \item \cmd{ch}{ -> } \ch{->} Standardpfeil nach rechts \item \cmd{ch}{ <- } \ch{<-} Standardpfeil nach links + \item \cmd{ch}{ -/> } \ch{-/>} reagiert nicht (rechts) + \item \cmd{ch}{ </- } \ch{</-} reagiert nicht (links) \item \cmd{ch}{ <-> } \ch{<->} Mesomerie-Pfeil \item \cmd{ch}{ <> } \ch{<>} Reaktion in beide Richtungen \item \cmd{ch}{ <=> } \ch{<=>} Gleichgewichts-Pfeil \item \cmd{ch}{ \lstinline+<=>>+ } \ch{<=>>} Gleichgewicht liegt rechts \item \cmd{ch}{ \lstinline+<<=>+ } \ch{<<=>} Gleichgewicht liegt links + \item \cmd{ch}{ <o> } \ch{<o>} Isolobal-Pfeil \end{description} Diese Pfeile werden alle mit \TikZ gezeichnet. \begin{beispiel} @@ -1625,10 +1679,10 @@ Der Beschriftungstext kann unabhängig vom Pfeil verarbeitet werden. Das Rezept \ch{A ->[H2O] B} \\ \ch{A ->[ H2O ] B} \\ \ch{A ->[ "\ox{2,Ca}" F2 ] B} \\ - \ch{A ->[$\Delta$,~ [H+ ] ] B} + \ch{A ->[$\Delta$,~ \[H+ \]] B} \end{beispiel} -Mit den Leerzeichen verarbeitet \chemformula den Teil zwischen den Klammern als normalen Input. Die Pfeile lesen ihre Argumente erst \emph{nach} der Verarbeitung. Wie Sie sehen können \enquote{wachsen} die Pfeile mit der Länge der Beschriftungen. Konstant bleibt der überstehende Teil. +Mit den Leerzeichen verarbeitet \chemformula den Teil zwischen den Klammern als normalen Input. Die Pfeile lesen ihre Argumente erst \emph{nach} der Verarbeitung. Wie Sie sehen können \enquote{wachsen} die Pfeile mit der Länge der Beschriftungen. Konstant bleibt der überstehende Teil. Im letzten Beispiel können Sie außerdem sehen, dass eckige Klammern in den Pfeilargumenten durch \cmd{[} und \cmd{]} erstellt werden sollten. Außerhalb von \cmd{ch} behalten Sie natürlich ihre übliche Bedeutung. Diese Befehle sind nötig da die sonst übliche Methode (Verstecken der Klammern in geschweiften Klammern) aufgrund der Art, wie \cmd{ch} sein Argument liest, nicht funktioniert. \begin{beispiel} \ch{A ->[a] B} \\ \ch{A ->[ab] B} \\ @@ -1636,7 +1690,8 @@ Mit den Leerzeichen verarbeitet \chemformula den Teil zwischen den Klammern als \ch{A ->[abc~abc] B} \\ % needs the `chemfig' package: \setatomsep{15pt} - \ch{A ->[ "\chemfig{-[:30]-[:-30]OH}" ] B} + \ch{A ->[ "\chemfig{-[:30]-[:-30]OH}" ] B} \\ + \ch{A ->[[]] B} vs. \ch{A ->[\[\]] B} \end{beispiel} \subsection{Anpassung}\secidx[Anpassung]{Pfeile} @@ -1645,8 +1700,8 @@ Mit folgenden Optionen können Sie das Erscheinungsbild der Pfeile anpassen: \item \key{arrow-offset}{<dim>} Die Länge, die ein Pfeil links und rechts über die Beschriftung hinausragt. Die Länge eines leeren Pfeils beträgt zwei mal \texttt{arrow-offset}. Eine \TeX-Länge. Default = \texttt{1.5ex} \item \key{arrow-yshift}{<dim>} Verschiebt einen Pfeil nach oben (positiver Wert) oder nach unten (negativer Wert). Eine \TeX-Länge. Default = \texttt{0pt} \item \key{arrow-ratio}{<factor>} Das Verhältnis der Pfeillängen der ver unbalancierten Gleichgewichtspfeile. \texttt{.4} würde bedeuten, dass der kürzere Pfeil $0.4$ mal so lang ist, wie der längere Pfeil. Default = \texttt{.6} - \item \key{arrow-tips}{<type>} Bestimmt die Pfeilspitzen. Im Prinzip könnten alle von \TikZ' Pfeilen verwendet werden. Die Option verlangt jedoch, dass erstens \texttt{<type>} selbst eine Pfeilspitze sein muss \emph{und} dass zweitens die Spitzen \texttt{left <type>} und \texttt{right <type>} definiert sein müssen. Wenn Sie also nicht selbst Pfeilspitzen definieren, können Sie nur zwischen \texttt{cf} und \texttt{to} wählen. Default = \texttt{cf} - \item \key{arrow-style}{<tikz>} \TikZ-Keys zur freien Gestaltung der Pfeile. +% \item \key{arrow-tips}{<type>} Bestimmt die Pfeilspitzen. Im Prinzip könnten alle von \TikZ' Pfeilen verwendet werden. Die Option verlangt jedoch, dass erstens \texttt{<type>} selbst eine Pfeilspitze sein muss \emph{und} dass zweitens die Spitzen \texttt{left <type>} und \texttt{right <type>} definiert sein müssen. Wenn Sie also nicht selbst Pfeilspitzen definieren, können Sie nur zwischen \texttt{cf} und \texttt{to} wählen. Default = \texttt{cf} +% \item \key{arrow-style}{<tikz>} \TikZ-Keys zur freien Gestaltung der Pfeile. \item \key{compound-sep}{<dim>} Der Leerraum zwischen Formeln und Pfeilen. Eine \TeX-Länge. Default = \texttt{1ex} \item \key{label-offset}{<dim>} Der Leerraum zwischen Pfeilen und ihrer Beschriftung. Eine \TeX-Länge. Default = \texttt{2pt} \item \key{label-style}{<font command>} Die relative Schriftgröße der Beschriftung. Default = \lstinline+\footnotesize+ @@ -1658,21 +1713,51 @@ Der folgende Code zeigt die Effekte der verschiedenen Optionen auf den \lstinlin l\"anger: \ch[arrow-offset=12pt]{A <=>>[x][y] B} \\ h\"oher: \ch[arrow-yshift=2pt]{A <=>>[x][y] B} \\ ausbalancierter: \ch[arrow-ratio=.8]{A <=>>[x][y] B} \\ - andere Pfeilspitzen: \ch[arrow-tips=to]{A <=>>[x][y] B} \\ Bschriftung weiter weg: \ch[label-offset=4pt]{A <=>>[x][y] B} \\ gr\"o\ss erer Abstand zu Formeln: \ch[compound-sep=2ex]{A <=>>[x][y] B} \\ - anderes TikZ: \ch[arrow-style={thick,red}]{A <=>>[x][y] B} \\ kleinere Beschriftungen: \ch[label-style=\tiny]{A <=>[x][y] B} \end{beispiel} -Wenn Sie Ihren eigenen pgfarrows oder passende Aliase so definieren\footnote{Lesen Sie das \textsc{pgfmanual} zu Details.}, dass Sie die Spitzen \texttt{<type>}, \texttt{left <type>} und \texttt{right <type>} verfügbar haben, können Sie sie mit \key{arrow-tips} verwenden: +\subsection{Pfeiltypen bearbeiten}\secidx[Typen!bearbeiten]{Pfeile} +Die Pfeile wurden mit dem Befehl +\begin{description} + \item \cmd{DeclareChemArrow}{<tokens>}\ma{<tikz>} +\end{description} +definiert. \ma{<tokens>} sind die Zeichen, die ersetzt werden mit dem tatsächlichen Pfeilcode. Der Hauptpfeil wurde \zB via +\begin{beispiel}[code only] + \DeclareChemArrow{->}{\draw[-cf] (cf_arrow_start) -- (cf_arrow_end) ;} +\end{beispiel} +definiert. Wenn Sie selbst Pfeile definieren wollen, benötigen Sie grundlegende Kenntnisse von \TikZ\footnote{Bitte lesen Sie dazu das \textsf{pgfmanual}.}. + +Es gibt einige vordefinierte Koordinaten, die Sie verwenden können und sollten: +\begin{description} + \item[\texttt{(cf\_arrow\_start)}] Der Pfeilanfang. + \item[\texttt{(cf\_arrow\_end)}] Das Pfeilende. + \item[\texttt{(cf\_arrow\_mid)}] Die Pfeilmitte. + \item[\texttt{(cf\_arrow\_mid\_start)}] Der Anfang des kürzeren Pfeils in Typen wie \lstinline+<=>>+. + \item[\texttt{(cf\_arrow\_mid\_end)}] Das Ende des kürzeren Pfeils in Typen wie \lstinline+<=>>+. + \item[\texttt{cf}, \texttt{left cf}, \texttt{right cf}] Für \chemformula definierte Pfeilspitzen. +\end{description} +\begin{beispiel} + \DeclareChemArrow{.>}{\draw[-cf,dotted,red] (cf_arrow_start) -- (cf_arrow_end);} + \DeclareChemArrow{n>}{\draw[-cf] (cf_arrow_start) .. controls ([yshift=3ex]cf_arrow_mid) .. (cf_arrow_end);} + \DeclareChemArrow{==}{ + \draw ([yshift=.2ex]cf_arrow_mid_start) -- ([yshift=.2ex]cf_arrow_mid_end); + \draw ([yshift=-.2ex]cf_arrow_mid_start) -- ([yshift=-.2ex]cf_arrow_mid_end); + } + \ch{A .> B} \ch{A .>[a][b] B} \ch{A n> B} \ch{A == B} +\end{beispiel} +Wenn Sie einen existierenden Pfeil umdefinieren möchten, können Sie folgende zwei Befehle verwenden: +\begin{description} + \item \cmd{RenewChemArrow}{<tokens>}\ma{<tikz>} + \item \cmd{ShowChemArrow}{<tokens>} +\end{description} +Der zweite zeigt Ihnen die bestehende Definition, der erste definiert den bestehenden Pfeil neu. \begin{beispiel} - % `left hook' and `right hook' are already defined in the tikzlibrary `arrows' - \pgfarrowsdeclarealias{hook}{hook}{hooks}{hooks}% - % `left hook reversed' and `right hook reversed' are already defined in the tikzlibrary `arrows' - \pgfarrowsdeclarealias{hook reversed}{hook reversed}{hooks reversed}{hooks reversed}% - \ch[arrow-tips=hook]{A -> B <=> C} \\ - \ch[arrow-tips=hook reversed]{A -> B <=> C} + \texttt{\ShowChemArrow{->}} \\ + \RenewChemArrow{->}{\draw[->,red] (cf_arrow_start) -- (cf_arrow_end) ;} + \texttt{\ShowChemArrow{->}} \\ + \ch{A -> B} \end{beispiel} \secidx*{Pfeile} @@ -1779,7 +1864,7 @@ Wenn Sie \XeLaTeX\ oder \LuaLaTeX\ verwenden und das Paket \paket{fontspec} gela Der Befehl \cmd{ch} kann in Mathematikumgebungen eingesetzt werden. Er erkennt \lstinline+\\+ und \lstinline+&+ und reicht sie weiter. Sie können aber die optionalen Argumente von \lstinline+\\+ nicht innerhalb von \cmd{ch} verwenden. \begin{beispiel} \begin{align} - \ch[arrow-tips=to]{ + \ch{ H2O & ->[a] H2SO4 \\ Cl2 & ->[x][y] CH4 } @@ -2079,7 +2164,7 @@ Wenn Sie einen Bug finden, wäre es am besten, Sie schickten mir ein minimales B Vielen Dank an alle, die mir schon Feedback zukommen ließen! -\printbibliography[title=Quellen]% TODO Überschrift in „Quellen“ ändern +\printbibliography[title=Quellen] \printindex diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.pdf Binary files differindex 606f7a751eb..46031085a57 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.pdf +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.pdf diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.tex b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.tex index 213595f0e3b..da23d9866e0 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.tex +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.tex @@ -64,7 +64,7 @@ \addbibresource{\jobname.bib} \begin{filecontents}{\jobname.bib} @book{iupac:greenbook, - author = {E. Richard Cohan and Tomislav Cvita\v{s} and Jeremy G. Frey and Bertil Holmström and kozo Kuchitsu and Roberto Marquardt and Ian Mills and Franco Pavese and Martin Quack and Jürgan Stohner and Herbert L. Strauss and Michio Takami and Anders J Thor}, + author = {E. Richard Cohan and Tomislav Cvita\v{s} and Jeremy G. Frey and Bertil Holmström and Kozo Kuchitsu and Roberto Marquardt and Ian Mills and Franco Pavese and Martin Quack and Jürgan Stohner and Herbert L. Strauss and Michio Takami and Anders J Thor}, title = {“Quantities, Symbols and Units in Physical Chemistry”, IUPAC Green Book}, edition = {3rd Edition. 2nd Printing}, year = {2008}, @@ -165,6 +165,8 @@ You might remember that \chemmacros' options all belong to different modules, se \ghsystem uses the packages \chemmacros, \paket{tabu}, \paket{longtable}, \paket{ifpdf} and \paket{graphicx}. \ghsystem has no own package options but passes all options on to \chemmacros. +\achtung{There are some deprecated commands and options which are not explained in the manual any more but still exist to ensure backwards compatibility. These commands issue a warning. They may be dropped some time in the future.} + \section{Motivation and Background} \chemmacros started some years ago as a growing list of custom macros that I frequently used. I cannot completely recall when and why I decided to release them as a package. Well \textendash\ here we go and you might find it useful, too, I hope. @@ -211,9 +213,10 @@ Both \chemformula and \ghsystem don't have package options of their own. If you \item \key[option]{circled}{\uline{formal}/all/none} \chemmacros uses two different kinds of charges\footnote{Thanks to Christoph Sch\"afer, who pointed out to me, that v1.1 handled the charges too sloppy!}, which indicate the usage of real ($+/-$) and formal (\fplus/\fminus) charges. The option \texttt{formal} distinguishes between them, option \texttt{none} displays them all without circle, option \texttt{all} circles all (default = \texttt{formal}) \item \key[option]{circletype}{\uline{chem}/math} This option switches between two kinds of circled charge symbols: \cmd{fplus} \fplus\ and \lstinline+$\oplus$+ $\oplus$. (default = \texttt{chem}) \item \key[option]{detect-bold}{\uline{true}/false} This option determines wether or not macros like \cmd{pKa} recognize a bold font series. \textbf{bold \pKa text} or {\chemsetup[option]{detect-bold}\textbf{bold \pKa text}}. (default = \texttt{false}) - \item \key[option]{EZ}{\uline{chemmacros}/cool} The command \cmd{E} is defined by the package \paket{cool} as well as by \chemmacros. With this option you can choose, which definition is used, see page \pageref{EZ}. (default = \texttt{chemmacros}). This option can only be chosen in the preamble. + \item \key[option]{EZ}{\uline{chemmacros}/cool} This option is deprecated! \item \key[option]{german}{\uline{true}/false} This option changes the commands \cmd{pKa}, \cmd{sld} and \cmd{lqd} (default = \texttt{false}). This option has the alias \key[option]{ngerman}. \item \key[option]{ghs}{\uline{true}/false} Disable the use of the \ghsystem package. Setting \key{ghs}{false} will prevent \chemmacros from loading \ghsystem. (default = \texttt{true}) + \item \key[option]{iupac}{auto/restricted/strict} Take care of how iupac naming commands are defined, see page \pageref{key:iupac} (default = \texttt{auto}) \item \key[option]{method}{\uline{chemformula}/mhchem} You can choose the method which \chemmacros will use for the reaction environments (see section \ref{ssec:mhchem_reaktionen}) and the typesetting of the particles (see section \ref{sec:teilchen}). (default = \texttt{chemformula}). This option can only be chosen in the preamble. \item \key[option]{Nu}{\uline{chemmacros}/mathspec} The package \paket{mathspec} also defines a macro \cmd{Nu}. This option chooses which definition holds, see page \pageref{Nu}. (default = \texttt{chemmacros}). This option can only be chosen in the preamble. \item \key[option]{strict}{\uline{true}/false} Setting \key{strict}{true} will turn all warning messages into erros messages. (default = \texttt{false}) @@ -267,11 +270,11 @@ Some simple macros for displaying often needed particles and a symbol. Please no \end{description} There is another command which allows to typeset radicals with charges and subscripts. \begin{description} - \item \cmd{R}[<sign>]{<subscript>} + \item \cmd{Rad}[<sign>]{<subscript>} \end{description} \begin{beispiel} - \R[+]{tert} \R[-]{sek} \R{prim} + \Rad[+]{tert} \Rad[-]{sek} \Rad{prim} \end{beispiel} The two particles \cmd{Nu} and \cmd{ba} can be modified. To do that you use the option \begin{description} @@ -303,7 +306,7 @@ Depending on the \key{method} you chose as option the \texttt{<definition>} will \cmd{DeclareChemParticle} only defines a particle if \texttt{<cmd>} is not already used by any other command. If it \emph{is} already used \chemmacros will either give a warning or an error, depending on the option \key{strict}. \cmd{RenewChemParticle} \emph{only} defines a particle if \texttt{<cmd>} \emph{is} already used and issues a warning/error otherwise. \secidx*{Particles, Ions and Symbols} -\section{Stereo Descriptors, Nomenclature, Latin Phrases}\label{sec:stereo} +\section{Nomenclature, Stereo Descriptors, Latin Phrases}\label{sec:stereo} \subsection{IUPAC Names}\secidx{IUPAC Names} Similar to the \paket{bpchem} package \chemmacros provides a command\footnote{The idea and the implementation is shamelessly borrowed from \paket*{bpchem} by Bjørn Pedersen.} to typeset IUPAC names. Why is that useful? IUPAC names can get very long. So long indeed that they span over more than two lines, especially in two-column documents. This means they must be allowed to be broken more than one time. This is what the following command does. \begin{description} @@ -316,31 +319,54 @@ Similar to the \paket{bpchem} package \chemmacros provides a command\footnote{Th \end{beispiel} The \cmd{iupac} command is more of a semantic command. Most times you can achieve (nearly) the same thing by using \cmd{-} instead of \cmd{\textbar}, \texttt{-} instead of \cmd{-} and \lstinline=\textsuperscript= instead of \cmd{\textasciicircum}. -\subsection{Stereo Descriptors and Nomenclature}\secidx{Stereo Descriptors and Nomenclature} +The command \cmd{iupac} serves another purpose, too. Regardless of the setting of the \key[option]{iupac} option all the commands presented in this section are always defined \emph{inside} \cmd{iupac}. Quite a number of the naming commands have very general names: \cmd{meta}, \cmd{D}, \cmd{E}, \cmd{L}, \cmd{R}, \cmd{S}, \cmd{trans} and so forth. This means they either are predefined already (\cmd{L} \L) or are easily defined by another package or class (the \paket{cool} package defines both \cmd{D} and \cmd{E}, for example). In order to give you control which commands are defined in which way, there is the package option \key[option]{iupac}\label{key:iupac}. It has three modes: +\begin{itemize} + \item \key{iupac}{auto}: if the commands are \emph{not} defined by any package or class you're using they are available generally, otherwise only \emph{inside} \cmd{iupac}. + \item \key{iupac}{restricted}: all naming commands are \emph{only} defined inside \cmd{iupac}. If the commands are defined by another package they of course have that meaning outside. They're not defined outside otherwise. + \item \key{iupac}{strict}: \chemmacros overwrites any other definition and makes the commands available throughout the document. Of course the commands can be redefined (but only in the document body). They will still be available inside \cmd{iupac} then. +\end{itemize} +\ref{tab:iupac_modes} demonstrates the different modes. + +\begin{table}[h] + \centering + \begin{tabular}{lccc}\toprule + & auto & restricted & strict \\\midrule + \lstinline=\L= & \L & \L & \iupac{\L} \\ + \lstinline=\iupac{\L}= & \iupac{\L} & \iupac{\L} & \iupac{\L} \\ + \lstinline=\D= & \D & -- & \D \\ + \lstinline=\iupac{\D}= & \iupac{\D} & \iupac{\D} & \iupac{\D} \\\bottomrule + \end{tabular} + \caption{Demonstration of \protect\key{iupac}'s modes.}\label{tab:iupac_modes} +\end{table} + +\subsubsection{Predefined Commands}\secidx[predefined]{IUPAC Names}\secidx{Stereo Descriptors and Nomenclature} The macros in this section are intended to make the writing of IUPAC names more convenient. \paragraph{Cahn-Ingold-Prelog}\index{Cahn-Ingold-Prelog}\secidx[Cahn-Ingold-Prelog]{IUPAC Names} \begin{description} - \item \cmd{Rcip} \Rcip - \item \cmd{Scip} \Scip \item \cmd{cip}{<conf>} \eg: \cmd{cip}{R,S} \cip{R,S} + \item \cmd{R} \iupac{\R} + \item \cmd{S} \iupac{\S} \end{description} +Since the command \cmd{S} has another meaning already (\S) it is only available inside \cmd{iupac} in the default setting. \paragraph{Fischer}\index{Fischer}\secidx[Fischer]{IUPAC Names} \begin{description} - \item \cmd{Dfi} \Dfi - \item \cmd{Lfi} \Lfi + \item \cmd{D} \iupac{\D} + \item \cmd{L} \iupac{\L} \end{description} +Since the command \cmd{L} has another meaning already (\L) it is only available inside \cmd{iupac} in the default setting. -\paragraph{cis/trans, zusammen/entgegen, syn/anti \& tert}\index{tert}\secidx[tert]{IUPAC Names}\index{cis/trans}\secidx[cis/trans]{IUPAC Names}\index{zusammen/entgegen}\secidx[zusammen/entgegen]{IUPAC Names}\secidx[syn/anti]{IUPAC Names} Please notice, that the commands \cmd{cis} and \cmd{trans} are defined by the \paket{bpchem} package as well. If you load that package, they are redefined by \chemmacros. With \paket{bpchem} they \textit{always} get a \lstinline+\xspace+, with \chemmacros \textit{never}. +\paragraph{cis/trans, zusammen/entgegen, syn/anti \& tert}\index{tert}\secidx[tert]{IUPAC Names}\index{cis/trans}\secidx[cis/trans]{IUPAC Names}\index{zusammen/entgegen}\secidx[zusammen/entgegen]{IUPAC Names}\secidx[syn/anti]{IUPAC Names} \begin{description} \item \cmd{cis} \cis \item \cmd{trans} \trans - \item \cmd{Z} \Z\label{EZ} - \item \cmd{E} \E\ (\cmd{E} is also defined by the package \paket{cool}. By using the package option \key{EZ}{cool} instead of \cmd{E} and \cmd{Z} \chemmacros defines \cmd{Ent} and \cmd{Zus}.) + \item \cmd{Z} \Z + \item \cmd{E} \E \item \cmd{syn} \syn \item \cmd{anti} \anti \item \cmd{tert} \tert \end{description} +The package \paket{cool} defines the commands \cmd{E} and \cmd{D}, too. If you load it, the \chemmacros version will only be available inside \cmd{iupac} in the default setting. \paragraph{ortho/meta/para}\index{ortho/meta/para}\secidx[ortho/meta/para]{IUPAC Names} \begin{description} @@ -357,9 +383,9 @@ The macros in this section are intended to make the writing of IUPAC names more Examples: \begin{beispiel} - \iupac{\Dfi\-Wein\|s\"aure} = \\ + \iupac{\D\-Wein\|s\"aure} = \\ \iupac{\cip{2S,3S}\-Wein\|s\"aure} \\ - \iupac{\Dfi\-($-$)\-Threose} = \\ + \iupac{\D\-($-$)\-Threose} = \\ \iupac{\cip{2S,3R}\-($-$)\-2,3,4\-Tri\|hydroxy\|butanal} \\ \iupac{\cis\-2\-Butene} = \\ \iupac{\Z\-2\-Butene}, \\ @@ -367,7 +393,29 @@ Examples: \iupac{\meta\-Xylol} = \\ \iupac{1,3\-Di\|methyl\|benzene} \end{beispiel} -\secidx*{IUPAC Names}\secidx*{Stereo Descriptors and Nomenclature} +\secidx*{Stereo Descriptors and Nomenclature} + +\subsubsection{Own Naming Commands}\secidx[own]{IUPAC Names} +If you find any commands missing you can define them using +\begin{description} + \item \cmd{DeclareChemIUPAC}{<cmd>}\ma{<declaration>} + \item \cmd{RenewChemIUPAC}{<cmd>}\ma{<declaration>} +\end{description} +A command defined in this way will obey the setting of the option \key[option]{iupac}. This means any existing command is only overwritten with \key{iupac}{strict}. However, \cmd{DeclareChemIUPAC} will \emph{not} change the definition of an existing IUPAC naming command but issue a warning/an error (depending on the package option \key{strict}) if the IUPAC naming command already exists. +\begin{beispiel} + % uses the `upgreek' package + \DeclareChemIUPAC\hapto{$\upeta$} + Ferrocene = \iupac{bis(\hapto\^5\-cyclo\|penta\|dienyl)iron} +\end{beispiel} + +\cmd{RenewChemIUPAC} allows you to redefine the existing iupac naming commands. +\begin{beispiel} + \iupac{\meta\-Xylol} \\ + \RenewChemIUPAC\meta{\textit{m}} + \iupac{\meta\-Xylol} +\end{beispiel} + +\secidx*{IUPAC Names} \subsection{Latin Phrases}\secidx{Latin Phrases} At last there are two commands for common latin phrases. @@ -454,7 +502,7 @@ There is a key which influences the behaviour of the charges. \end{description} This is how the key influences the behaviour: \begin{beispiel} - \chemsetup[charges]{append=false} + \chemsetup{charges/append=false,phases/pos=sub} \ce{H\pch\aq} \ce{H\aq\pch} \chemsetup[charges]{append=true} @@ -462,7 +510,7 @@ This is how the key influences the behaviour: \end{beispiel} In most cases this behaviour will be unwanted. However, in some cases it might be useful, for example together with the \cmd{ox} command (see next section): \begin{beispiel} - \chemsetup[charges]{append=false} + \chemsetup{charges/append=false,phases/pos=sub} \ce{\ox{1,H}\pch\aq} \chemsetup[charges]{append=true} @@ -552,11 +600,11 @@ These macros for example can be used with the \cmd{ox} command or with the \pake The following macros are useful together with \paket{chemfig}, too. \begin{description} - \item \cmd{scrp} \scrp (\textbf{scr}iptstyle + \textbf{p}lus) - \item \cmd{scrm} \scrm (\textbf{scr}iptstyle + \textbf{m}inus) + \item \cmd{scrp} \scrp\ (\textbf{scr}iptstyle + \textbf{p}lus) + \item \cmd{scrm} \scrm\ (\textbf{scr}iptstyle + \textbf{m}inus) \item \cmd{fscrp} \fscrp \item \cmd{fscrm} \fscrm - \item \cmd{fsscrp} \fsscrp (using \lstinline+\scriptscriptstyle+) + \item \cmd{fsscrp} \fsscrp\ (using \lstinline+\scriptscriptstyle+) \item \cmd{fsscrm} \fsscrm \end{description} @@ -595,7 +643,6 @@ one can specify the most common reaction mechanisms. \texttt{<type>} can have on \item \cmd{redox}(<name1>,<name2>)[<tikz>][<num>]{<text>} \end{description} - \cmd{OX} places \texttt{<atom>} into a node, which is named with \texttt{<name>}. If you have set two \cmd{OX}, they can be connected with a line using \cmd{redox}. To do so the names of the two nodes that are to be connected are written in the round braces. Since \cmd{redox} draws a tikzpicture with options \texttt{remember picture,overlay}, the document needs to be \emph{compiled at least two times}. \begin{beispiel}[ox] \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b){oxidation} @@ -632,22 +679,28 @@ can be used to change the distance between the atom and the beginning of the lin Examples: \begin{beispiel}[ox] - \ch{ 2 "\OX{o1,Na}" + "\OX{r1,Cl}" {}2 -> 2 "\OX{o2,Na}" \pch{} + 2 "\OX{r2,Cl}" \mch } + \ch{ 2 "\OX{o1,Na}" + "\OX{r1,Cl}" {}2 -> 2 "\OX{o2,Na}" \pch{} + 2 +"\OX{r2,Cl}" \mch } \redox(o1,o2){\small OX: $- 2\el$} \redox(r1,r2)[][-1]{\small RED: $+ 2\el$} \end{beispiel} \begin{beispiel}[ox] - \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" \pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } + \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" +\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } \redox(o1,o2){\small OX: $- 2\el$} \redox(r1,r2)[][-1]{\small RED: $+ 2\el$} \end{beispiel} +\bspmidlength{ox}{15mm} \begin{beispiel}[ox] - \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" \pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } + \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" +\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } \redox(o1,o2)[draw=red,->][3.33]{\small OX: $- 2\el$} \redox(r1,r2)[draw=blue,->]{\small RED: $+ 2\el$} \end{beispiel} -\begin{beispiel}[ox] - \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" \pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } +\bspmidlength{ox}{7mm} + \begin{beispiel}[ox] + \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" +\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch } \redox(o1,o2)[green,-stealth]{\small OX} \redox(r1,r2)[purple,-stealth][-1]{\small RED} \end{beispiel} @@ -694,13 +747,13 @@ The unit is set corresponding to the rules of \paket{siunitx} and depends on its \subsubsection{Create New Variables} You can use the command \begin{description} - \item \cmd{setnewstate}[<keyval>]{<name>}{<symbol>}\ma{<unit>} + \item \cmd{DeclareChemState}[<keyval>]{<name>}\ma{<symbol>}\ma{<unit>} \end{description} to create new corresponding commands: \begin{beispiel} - \setnewstate{Helmholtz}{A}{\kilo\joule\per\mole} - \setnewstate[subscript-left=false,exponent=]{ElPot}{E}{\volt} + \DeclareChemState{Helmholtz}{A}{\kilo\joule\per\mole} + \DeclareChemState[subscript-left=false,exponent=]{ElPot}{E}{\volt} \Helmholtz{123.4} \\ \ElPot{-1.1} \\ \ElPot[exponent=0]($\ch{Sn}|\ch{Sn^2+}||\ch{Pb^2+}|\ch{Pb}$){0.01} @@ -717,20 +770,20 @@ The command has some keys with which the default behaviour of the new command ca \subsubsection{Redefine Variables} With \begin{description} - \item \cmd{renewstate}[<keyval>]{<name>}{<symbol>}\ma{<unit>} + \item \cmd{RenewChemState}[<keyval>]{<name>}\ma{<symbol>}\ma{<unit>} \end{description} you can redefine the already existing commands: \begin{beispiel} - \renewstate{Enthalpy}{h}{\joule} + \RenewChemState{Enthalpy}{h}{\joule} \Enthalpy(f){12.5} \end{beispiel} -The command is analogous to \cmd{setnewstate}, \ie it has the same keys. +The command is analogous to \cmd{DeclareChemState}, \ie it has the same keys. So \textendash\ for following thermodynamic conventions \textendash\ one could define a molar and an absolute variable: \begin{beispiel} - \setnewstate[exponent=]{enthalpy}{h}{\kilo\joule\per\mole}% molar - \renewstate[exponent=]{Enthalpy}{H}{\kilo\joule}% absolute + \DeclareChemState[exponent=]{enthalpy}{h}{\kilo\joule\per\mole}% molar + \RenewChemState[exponent=]{Enthalpy}{H}{\kilo\joule}% absolute \enthalpy{-12.3} \Enthalpy{-12.3} \end{beispiel} @@ -892,7 +945,7 @@ If you want to change the layout of the counter tags, you can use \subsection{Own Reactions} You can create new types of reactions with the command: \begin{description} - \item \cmd{newreaction}[<keyval>]{<name>}\ma{<math name>} + \item \cmd{DeclareChemReaction}[<keyval>]{<name>}\ma{<math name>} \end{description} \texttt{<name>} will be the name of the new environment. \texttt{<math name>} is the used math environment. @@ -908,17 +961,17 @@ Then there is \key*{arg}, which is used to define an environment with a mandator The predefined environments are defined via \begin{description} - \item \cmd{newreaction}[star]{reaction}\ma{equation} and - \item \cmd{reaction}[star]{reactions}\ma{align}. + \item \cmd{DeclareChemReaction}[star]{reaction}\ma{equation} and + \item \cmd{DeclareChemReaction}[star]{reactions}\ma{align}. \end{description} Let's suppose, you'd like to have the alignment behaviour of the \texttt{alignat} environment for \chemformula/\paket{mhchem} reactions. You could do the following: -\cmd{newreaction}[star,arg]{reactionsat}{alignat} +\cmd{DeclareChemReaction}[star,arg]{reactionsat}\ma{alignat} With this the \texttt{reactionsat} environment is defined. \begin{beispiel} - \newreaction[star,arg]{reactionsat}{alignat} + \DeclareChemReaction[star,arg]{reactionsat}{alignat} \begin{reactionsat}{3} A &-> B &&-> C &&-> D \\ aaaaa &-> bbbbb &&-> ccccc &&-> ddddd @@ -1149,76 +1202,76 @@ Some keys can be set without value. Then the \uline{underlined} value is used. \bottomrule \endfoot \multicolumn{5}{l}{package options:} \\ - bpchem & option & \uline{true}/false & false & page \pageref{key:option_bpchem} \\ - circled & option & \uline{formal}/all/none & formal & page \pageref{key:option_circled} \\ - circletype & option & \uline{chem}/math & chem & page \pageref{key:option_circletype} \\ - detect-bold & option & \uline{true}/false & false & page \pageref{key:option_detect-bold} \\ - EZ & option & \uline{chemmacros}/cool & chemmacros & page \pageref{key:option_EZ} \\ - german & option & \uline{true}/false & false & page \pageref{key:option_german} \\ - ghs & option & \uline{true}/false & true & page \pageref{key:option_ghs} \\ - method & option & \uline{chemformula}/formula & formula & page \pageref{key:option_method} \\ - Nu & option & \uline{chemmacros}/mathspec & chemmacros & page \pageref{key:option_Nu} \\ - strict & option & \uline{true}/false & false & page \pageref{key:option_strict} \\ - synchronize & option & \uline{true}/false & false & page \pageref{key:option_synchronize} \\ - version & option & 1/2/bundle & bundle & page \pageref{key:option_version} \\ - xspace & option & \uline{true}/false & true & page \pageref{key:option_xspace} \\ + bpchem & option & \uline{true}/false & false & page \pageref{key:option_bpchem} \\ + circled & option & formal/\uline{all}/none & formal & page \pageref{key:option_circled} \\ + circletype & option & chem/math & chem & page \pageref{key:option_circletype} \\ + detect-bold & option & \uline{true}/false & false & page \pageref{key:option_detect-bold} \\ + german & option & \uline{true}/false & false & page \pageref{key:option_german} \\ + ghs & option & \uline{true}/false & true & page \pageref{key:option_ghs} \\ + iupac & option & auto/restricted/strict & auto & page \pageref{key:option_iupac} \\ + method & option & chemformula/formula & formula & page \pageref{key:option_method} \\ + Nu & option & chemmacros/mathspec & chemmacros & page \pageref{key:option_Nu} \\ + strict & option & \uline{true}/false & false & page \pageref{key:option_strict} \\ + synchronize & option & \uline{true}/false & false & page \pageref{key:option_synchronize} \\ + version & option & 1/2/bundle & bundle & page \pageref{key:option_version} \\ + xspace & option & \uline{true}/false & true & page \pageref{key:option_xspace} \\ \multicolumn{5}{l}{\cmd{ba}, \cmd{Nu}:} \\ - elpair & particle & \uline{dots}/dash/false & false & page \pageref{key:particle_elpair} \\ + elpair & particle & \uline{dots}/dash/false & false & page \pageref{key:particle_elpair} \\ \multicolumn{5}{l}{\cmd{pch}, \cmd{mch}, \cmd{fpch}, \cmd{fmch}:} \\ - append & charges & \uline{true}/false & false & page \pageref{key:charges_append} \\ + append & charges & \uline{true}/false & false & page \pageref{key:charges_append} \\ \multicolumn{5}{l}{\cmd{ox}:} \\ - parse & ox & \uline{true}/false & true & page \pageref{key:ox_parse} \\ - roman & ox & \uline{true}/false & true & page \pageref{key:ox_roman} \\ - pos & ox & top/super/side & top & page \pageref{key:ox_pos} \\ - explicit-sign & ox & \uline{true}/false & false & page \pageref{key:ox_explicit-sign} \\ - decimal-marker & ox & comma/point & point & page \pageref{key:ox_decimal-marker} \\ + parse & ox & \uline{true}/false & true & page \pageref{key:ox_parse} \\ + roman & ox & \uline{true}/false & true & page \pageref{key:ox_roman} \\ + pos & ox & top/super/side & top & page \pageref{key:ox_pos} \\ + explicit-sign & ox & \uline{true}/false & false & page \pageref{key:ox_explicit-sign} \\ + decimal-marker & ox & comma/point & point & page \pageref{key:ox_decimal-marker} \\ \multicolumn{5}{l}{\cmd{OX}, \cmd{redox}:} \\ - dist & redox & <dim> & .6em & page \pageref{key:redox_dist} \\ - sep & redox & <dim> & .2em & page \pageref{key:redox_sep} \\ + dist & redox & <dim> & .6em & page \pageref{key:redox_dist} \\ + sep & redox & <dim> & .2em & page \pageref{key:redox_sep} \\ \multicolumn{5}{l}{\cmd{Enthalpy}, \cmd{Entropy}, \cmd{Gibbs}:} \\ - exponent & & <anything> & \cmd{standardstate} & page \pageref{key:none_exponent} \\ - delta & & <anything>/false & & page \pageref{key:none_delta} \\ - subscript & & left/right & & page \pageref{key:none_subscript} \\ - unit & & <unit> & & page \pageref{key:none_unit} \\ - \multicolumn{5}{l}{\cmd{setnewstate}, \cmd{renewstate}:} \\ - exponent & & <anything> & \cmd{standardstate} & page \pageref{key:none_exponent} \\ - delta & & <anything>/false & & page \pageref{key:none_delta} \\ - subscript & & <anything> & & page \pageref{key:none_subscript} \\ - subscript-left & & true/false & & page \pageref{key:none_subscript-left} \\ + exponent & & <anything> & \cmd{standardstate} & page \pageref{key:none_exponent} \\ + delta & & <anything>/false & & page \pageref{key:none_delta} \\ + subscript & & left/right & & page \pageref{key:none_subscript} \\ + unit & & <unit> & & page \pageref{key:none_unit} \\ + \multicolumn{5}{l}{\cmd{DeclareChemState}, \cmd{RenewChemState}:} \\ + exponent & & <anything> & \cmd{standardstate} & page \pageref{key:none_exponent} \\ + delta & & <anything>/false & & page \pageref{key:none_delta} \\ + subscript & & <anything> & & page \pageref{key:none_subscript} \\ + subscript-left & & \uline{true}/false & & page \pageref{key:none_subscript-left} \\ \multicolumn{5}{l}{\cmd{State}:} \\ - exponent & state & <anything> & \cmd{standardstate} & page \pageref{key:state_exponent} \\ - delta & state & <anything>/false & & page \pageref{key:state_delta} \\ - subscript-left & state & true/false & & page \pageref{key:state_subscript-left} \\ + exponent & state & <anything> & \cmd{standardstate} & page \pageref{key:state_exponent} \\ + delta & state & <anything>/false & & page \pageref{key:state_delta} \\ + subscript-left & state & \uline{true}/false & & page \pageref{key:state_subscript-left} \\ \multicolumn{5}{l}{\cmd{NMR}:} \\ - unit & nmr & <unit> & \cmd{mega}\cmd{hertz} & page \pageref{key:nmr_unit} \\ - nucleus & nmr & \{<num>,<atom symbol>\} & \{1,H\} & page \pageref{key:nmr_nucleus} \\ - \multicolumn{5}{l}{\cmd{newreaction}:} \\ - star & & \uline{true}/false & false & page \pageref{key:none_star} \\ - arg & & \uline{true}/false & false & page \pageref{key:none_arg} \\ - list-name & reaction & <anything> & List of reactions & page \pageref{key:reaction_list-name} \\ - list-entry & reaction & <anything> & Reaction & page \pageref{key:reaction_list-entry} \\ + unit & nmr & <unit> & \cmd{mega}\cmd{hertz} & page \pageref{key:nmr_unit} \\ + nucleus & nmr & \{<num>,<atom symbol>\} & \{1,H\} & page \pageref{key:nmr_nucleus} \\ + \multicolumn{5}{l}{\cmd{DeclareChemReaction}:} \\ + star & & \uline{true}/false & false & page \pageref{key:none_star} \\ + arg & & \uline{true}/false & false & page \pageref{key:none_arg} \\ + list-name & reaction & <anything> & List of reactions & page \pageref{key:reaction_list-name} \\ + list-entry & reaction & <anything> & Reaction & page \pageref{key:reaction_list-entry} \\ \multicolumn{5}{l}{\cmd{mhName}:} \\ - align & mhName & <alignment> & \cmd{centering} & page \pageref{key:mhName_align} \\ - format & mhName & <commands> & & page \pageref{key:mhName_format} \\ - fontsize & mhName & <fontsize> & \cmd{tiny} & page \pageref{key:mhName_fontsize} \\ - width & mhName & <dim> & & page \pageref{key:mhName_width} \\ + align & mhName & <alignment> & \cmd{centering} & page \pageref{key:mhName_align} \\ + format & mhName & <commands> & & page \pageref{key:mhName_format} \\ + fontsize & mhName & <fontsize> & \cmd{tiny} & page \pageref{key:mhName_fontsize} \\ + width & mhName & <dim> & & page \pageref{key:mhName_width} \\ \multicolumn{5}{l}{phases:} \\ - pos & phases & side/sub & side & page \pageref{key:phases_pos} \\ - space & phases & <dim> & .1333em & page \pageref{key:phases_space} \\ + pos & phases & side/sub & side & page \pageref{key:phases_pos} \\ + space & phases & <dim> & .1333em & page \pageref{key:phases_space} \\ \multicolumn{5}{l}{\cmd{newman}:} \\ - angle & newman & <angle> & 0 & page \pageref{key:newman_angle} \\ - scale & newman & <factor> & 1 & page \pageref{key:newman_scale} \\ - ring & newman & <tikz> & & page \pageref{key:newman_ring} \\ - atoms & newman & <tikz> & & page \pageref{key:newman_atoms} \\ - back-atoms & newman & <tikz> & & page \pageref{key:newman_back-atoms} \\ + angle & newman & <angle> & 0 & page \pageref{key:newman_angle} \\ + scale & newman & <factor> & 1 & page \pageref{key:newman_scale} \\ + ring & newman & <tikz> & & page \pageref{key:newman_ring} \\ + atoms & newman & <tikz> & & page \pageref{key:newman_atoms} \\ + back-atoms & newman & <tikz> & & page \pageref{key:newman_back-atoms} \\ \multicolumn{5}{l}{\cmd{orbital} \ttfamily <type> = s/p/sp/sp2/sp3:} \\ - phase & orbital/<type> & \uline{+}/- & + & page \pageref{key:orbital_phase} \\ - scale & orbital/<type> & <factor> & 1 & page \pageref{key:orbital_scale} \\ - color & orbital/<type> & <color> & black & page \pageref{key:orbital_color} \\ - angle & orbital/<type> & <angle> & 90 & page \pageref{key:orbital_angle} \\ - half & orbital/p & \uline{true}/false & false & page \pageref{key:orbital_half} \\ - overlay & orbital & \uline{true}/false & false & page \pageref{key:orbital_overlay} \\ - opacity & ornital & <num> & 1 & page \pageref{key:orbital_opacity} + phase & orbital/<type> & +/- & + & page \pageref{key:orbital_phase} \\ + scale & orbital/<type> & <factor> & 1 & page \pageref{key:orbital_scale} \\ + color & orbital/<type> & <color> & black & page \pageref{key:orbital_color} \\ + angle & orbital/<type> & <angle> & 90 & page \pageref{key:orbital_angle} \\ + half & orbital/p & \uline{true}/false & false & page \pageref{key:orbital_half} \\ + overlay & orbital & \uline{true}/false & false & page \pageref{key:orbital_overlay} \\ + opacity & ornital & <num> & 1 & page \pageref{key:orbital_opacity} \end{longtable} \normalsize\secidx*{Option Overview (chemmacros)} \secidx*{CHEMMACROS} @@ -1563,15 +1616,18 @@ The space that is inserted after a math group can be edited: \section{Arrows}\label{sec:arrows}\secidx{Arrows} \subsection{Arrow types}\secidx[types]{Arrows} -Arrows are input in the same intuitive way they are with \paket{mhchem}. There are six different types: +Arrows are input in the same intuitive way they are with \paket{mhchem}. There are various different types: \begin{description} \item \cmd{ch}{ -> } \ch{->} standard right arrow \item \cmd{ch}{ <- } \ch{<-} standard left arrow + \item \cmd{ch}{ -/> } \ch{-/>} does not react (right) + \item \cmd{ch}{ </- } \ch{</-} does not react (left) \item \cmd{ch}{ <-> } \ch{<->} resonance arrow \item \cmd{ch}{ <> } \ch{<>} reaction in both directions \item \cmd{ch}{ <=> } \ch{<=>} equilibrium arrow \item \cmd{ch}{ \lstinline+<=>>+ } \ch{<=>>} unbalanced equilibrium arrow to the right \item \cmd{ch}{ \lstinline+<<=>+ } \ch{<<=>} unbalanced equilibrium arrow to the left + \item \cmd{ch}{ <o> } \ch{<o>} isolobal arrow \end{description} All these arrows are drawn with \TikZ. \begin{beispiel} @@ -1599,9 +1655,9 @@ The label text can be parsed seperately from the arrow. The recipe is easy: leav \ch{A ->[H2O] B} \\ \ch{A ->[ H2O ] B} \\ \ch{A ->[ "\ox{2,Ca}" F2 ] B} \\ - \ch{A ->[$\Delta$,~ [H+ ] ] B} + \ch{A ->[$\Delta$,~ \[H+ \]] B} \end{beispiel} -If you leave the blanks \chemformula treats the groups inside the square brackets as seperated input types. The arrow reads its arguments \emph{afterwards}. As you can see the arrows \enquote{grow} with the length of the labels. What stays constant is the part that protrudes the labels. +If you leave the blanks \chemformula treats the groups inside the square brackets as seperated input types. The arrow reads its arguments \emph{afterwards}. As you can see the arrows \enquote{grow} with the length of the labels. What stays constant is the part that protrudes the labels. As you also can see in the last example square brackets inside the arrow arguments should be produced using \cmd{[} and \cmd{]}. They keep their usual meaning outside \cmd{ch}. These commands are necessary since the usual grouping (\ie hiding the brackets inside curly brackets) doesn't work due to the way \cmd{ch} reads its argument. \begin{beispiel} \ch{A ->[a] B} \\ \ch{A ->[ab] B} \\ @@ -1609,7 +1665,8 @@ If you leave the blanks \chemformula treats the groups inside the square bracket \ch{A ->[abc~abc] B} \\ % needs the `chemfig' package: \setatomsep{15pt} - \ch{A ->[ "\chemfig{-[:30]-[:-30]OH}" ] B} + \ch{A ->[ "\chemfig{-[:30]-[:-30]OH}" ] B} \\ + \ch{A ->[[]] B} vs. \ch{A ->[\[\]] B} \end{beispiel} \subsection{Customization}\secidx[customization]{Arrows} @@ -1618,8 +1675,8 @@ These are the options which enable you to customize the arrows: \item \key{arrow-offset}{<dim>} This is the length that an arrow protrudes a label on both sides. This means an empty arrow's length is two times \texttt{arrow-offset}. Default = \texttt{1.5ex} \item \key{arrow-yshift}{<dim>} Shifts an arrow up (positive value) or down (negative value). Default = \texttt{0pt} \item \key{arrow-ratio}{<factor>} The ratio of the arrow lengths of the unbalanced equilibrium. \texttt{.4} would mean that the length of the shorter arrow is $0.4\times$ the length of the longer arrow. Default = \texttt{.6} - \item \key{arrow-tips}{<type>} This specifies the arrow tips. In principle all of \TikZ' arrows could be used. However, this option requires \texttt{<type>} to be an arrow tip itself \emph{and} to have a \texttt{left <type>} and \texttt{right <type>} to be defined. This means if you don't define any arrow tips yourself you can only choose between \texttt{cf} and \texttt{to}. Default = \texttt{cf} - \item \key{arrow-style}{<tikz>} \TikZ keys for free customization of the arrows. +% \item \key{arrow-tips}{<type>} This specifies the arrow tips. In principle all of \TikZ' arrows could be used. However, this option requires \texttt{<type>} to be an arrow tip itself \emph{and} to have a \texttt{left <type>} and \texttt{right <type>} to be defined. This means if you don't define any arrow tips yourself you can only choose between \texttt{cf} and \texttt{to}. Default = \texttt{cf} +% \item \key{arrow-style}{<tikz>} \TikZ keys for free customization of the arrows. \item \key{compound-sep}{<dim>} The space between compounds and the arrows. Default = \texttt{1ex} \item \key{label-offset}{<dim>} The space between the labels and the arrows. Default = \texttt{2pt} \item \key{label-style}{<font command>} The relative font size of the labels. Default = \lstinline+\footnotesize+ @@ -1631,21 +1688,49 @@ The following code shows the effect of the different options on the \lstinline+< longer: \ch[arrow-offset=12pt]{A <=>>[x][y] B} \\ higher: \ch[arrow-yshift=2pt]{A <=>>[x][y] B} \\ more balanced: \ch[arrow-ratio=.8]{A <=>>[x][y] B} \\ - other arrow tips: \ch[arrow-tips=to]{A <=>>[x][y] B} \\ labels further away: \ch[label-offset=4pt]{A <=>>[x][y] B} \\ larger distance to compounds: \ch[compound-sep=2ex]{A <=>>[x][y] B} \\ - other TikZ: \ch[arrow-style={thick,red}]{A <=>>[x][y] B} \\ smaller labels: \ch[label-style=\tiny]{A <=>[x][y] B} \end{beispiel} -If you define own pgfarrows\footnote{See the pgfmanual for details.} or the suiting aliases so that you have the arrow tips \texttt{<type>}, \texttt{left <type>} and \texttt{right <type>} available you can use them with the option \key{arrow-tips}: +\subsection{Modify Arrow Types}\secidx[types!modify]{Arrows} +The arrows are defined with the command +\begin{description} + \item \cmd{DeclareChemArrow}{<tokens>}\ma{<tikz>} +\end{description} +\ma{<tokens>} is the sequence of tokens that is replaced with the actual arrow code. For example the basic arrow is defined via +\begin{beispiel}[code only] + \DeclareChemArrow{->}{\draw[-cf] (cf_arrow_start) -- (cf_arrow_end) ;} +\end{beispiel} +In order to define arrows yourself you need to know the basics of \TikZ\footnote{Please see the \textsf{pgfmanual} for details.}. There are some predefined coordinates you can and should use: +\begin{description} + \item[\texttt{(cf\_arrow\_start)}] The beginning of the arrow. + \item[\texttt{(cf\_arrow\_end)}] The end of the arrow. + \item[\texttt{(cf\_arrow\_mid)}] The mid of the arrow. + \item[\texttt{(cf\_arrow\_mid\_start)}] The beginning of the shorter arrow in types like \lstinline+<=>>+. + \item[\texttt{(cf\_arrow\_mid\_end)}] The end of the shorter arrow in types like \lstinline+<=>>+. + \item[\texttt{cf}, \texttt{left cf}, \texttt{right cf}] \chemformula's own arrow heads. +\end{description} +\begin{beispiel} + \DeclareChemArrow{.>}{\draw[-cf,dotted,red] (cf_arrow_start) -- (cf_arrow_end);} + \DeclareChemArrow{n>}{\draw[-cf] (cf_arrow_start) .. controls ([yshift=3ex]cf_arrow_mid) .. (cf_arrow_end);} + \DeclareChemArrow{==}{ + \draw ([yshift=.2ex]cf_arrow_mid_start) -- ([yshift=.2ex]cf_arrow_mid_end); + \draw ([yshift=-.2ex]cf_arrow_mid_start) -- ([yshift=-.2ex]cf_arrow_mid_end); + } + \ch{A .> B} \ch{A .>[a][b] B} \ch{A n> B} \ch{A == B} +\end{beispiel} +If you want to redefine an existing arrow there are two commands you can use: +\begin{description} + \item \cmd{RenewChemArrow}{<tokens>}\ma{<tikz>} + \item \cmd{ShowChemArrow}{<tokens>} +\end{description} +The second one gives the current definition, the first one redefines an existing arrow. \begin{beispiel} - % `left hook' and `right hook' are already defined in the tikzlibrary `arrows' - \pgfarrowsdeclarealias{hook}{hook}{hooks}{hooks}% - % `left hook reversed' and `right hook reversed' are already defined in the tikzlibrary `arrows' - \pgfarrowsdeclarealias{hook reversed}{hook reversed}{hooks reversed}{hooks reversed}% - \ch[arrow-tips=hook]{A -> B <=> C} \\ - \ch[arrow-tips=hook reversed]{A -> B <=> C} + \texttt{\ShowChemArrow{->}} \\ + \RenewChemArrow{->}{\draw[->,red] (cf_arrow_start) -- (cf_arrow_end) ;} + \texttt{\ShowChemArrow{->}} \\ + \ch{A -> B} \end{beispiel} \secidx*{Arrows} @@ -1748,7 +1833,7 @@ If you're using \XeLaTeX\ or \LuaLaTeX\ and have loaded \paket{fontspec} you hav The \cmd{ch} command can be used inside math equations. It recognizes \lstinline+\\+ and \lstinline+&+ and passes them on. However, you can't use the optional arguments of \lstinline+\\+ inside \cmd{ch}. \begin{beispiel} \begin{align} - \ch[arrow-tips=to]{ + \ch{ H2O & ->[a] H2SO4 \\ Cl2 & ->[x][y] CH4 } diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty index b5e74df2f90..1c7c0f75735 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/02/10 - % +% - 2012/02/19 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -28,7 +28,11 @@ % - The Current Maintainer of this work is Clemens Niederberger. - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \RequirePackage{ expl3 } -\ProvidesExplPackage {chemformula} {2012/02/10} {3.0d} {typeset chemical compounds and reactions} +\ProvidesExplPackage + {chemformula} + {2012/02/19} + {3.1} + {typeset chemical compounds and reactions} %-----------------------------------------------------------------------------% % WARNING AND ERROR MESSAGES @@ -52,6 +56,23 @@ \token_to_str:N \usepackage \{ chemmacros \}. } +\msg_set:nnnn { chemformula } { declare-arrow } + { + The~arrow~type~ \tl_to_str:n { #1 } \c_space_tl is~already~defined. + } + { + You've~tried~to~define~the~arrow~type~\tl_to_str:n { #1 } \c_space_tl with + ~\token_to_str:N \DeclareChemArrow \c_space_tl but~it~already~exists. + ~Choose~another~name. + } + +\msg_set:nnnn { chemformula } { renew-arrow } + { The~arrow~type~ \tl_to_str:n { #1 } \c_space_tl is~not~defined. } + { + You've~tried~to~renew~the~arrow~type~\tl_to_str:n { #1 } ~but~it~doesn't~ + exist. + } + %-----------------------------------------------------------------------------% % test, if we are loaded without the `chemmacros' package \cs_if_exist:cF { ver@chemmacros.sty } @@ -78,7 +99,8 @@ % Some basic internal commands: \cs_new:Nn \chemformula_plus: { - \bool_if:nTF { \l_chemmacros_circled_bool && !\l_chemmacros_circled_formal_bool } + \bool_if:nTF + { \l_chemmacros_circled_bool && !\l_chemmacros_circled_formal_bool } { \bool_if:NTF \l_chemmacros_circled_chem_bool { \chemmacros_fplus: } @@ -93,7 +115,8 @@ \cs_new:Nn \chemformula_minus: { - \bool_if:nTF { \l_chemmacros_circled_bool && !\l_chemmacros_circled_formal_bool } + \bool_if:nTF + { \l_chemmacros_circled_bool && !\l_chemmacros_circled_formal_bool } { \bool_if:NTF \l_chemmacros_circled_chem_bool { \chemmacros_fminus: } @@ -264,267 +287,178 @@ \tl_new:N \l_chemformula_arrow_label_style_tl \tl_set:Nn \l_chemformula_arrow_label_style_tl { \footnotesize } -% <-> -\NewDocumentCommand \chemformula_arrow_mesomeric:w { O{}O{} } +\prop_new:N \l_chemformula_arrows_code_prop +\tl_new:N \l_chemformula_arrow_type_tl +\tl_new:N \l_chemformula_arrow_arg_i_tl +\tl_new:N \l_chemformula_arrow_arg_ii_tl + +% read optional arguments +\cs_new_nopar:Npn \l_chemformula_arrow_read_args:w { - \chemformula_determine_arrow_length:nn { #1 } { #2 } - \chemformula_tikz:nf { inner~sep=0, baseline=(chemformula_arrow_start.base) } - { - \chemformula_draw:xn - { \l_chemformula_arrow_head_tl-\l_chemformula_arrow_head_tl , \l_chemformula_arrow_style_tl } - { - coordinate (chemformula_arrow_start) (0,0) - ++ (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) - node - [ - pos=.5, - above=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #1 } - node - [ - pos=.5, - below=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #2 } - } - \chemformula_draw:nn {} - { - (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) ++ - ( \l_chemformula_compound_sep_dim + \dim_use:N \l_chemformula_arrow_length_dim , 0) - } - } + \peek_meaning:NTF [ + { \l_chemformula_arrow_read_args_aux_i:w } + { \l_chemformula_arrow_read_args_aux_iii: } } -% -> -\NewDocumentCommand \chemformula_arrow_right:w { O{}O{} } +\cs_new_nopar:Npn \l_chemformula_arrow_read_args_aux_i:w [#1] { - \chemformula_determine_arrow_length:nn { #1 } { #2 } - \chemformula_tikz:nn { inner~sep=0, baseline=(chemformula_arrow_start.base) } - { - \chemformula_draw:xn { -\l_chemformula_arrow_head_tl , \l_chemformula_arrow_style_tl } - { - coordinate (chemformula_arrow_start) (0,0) - ++ (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) - node - [ - pos=.5, - above=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #1 } - node - [ - pos=.5, - below=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #2 } - } - \chemformula_draw:nn {} - { - (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) ++ - ( \l_chemformula_compound_sep_dim + \dim_use:N \l_chemformula_arrow_length_dim , 0) - } - } + \tl_set:Nn \l_chemformula_arrow_arg_i_tl { #1 } + \peek_meaning:NTF [ + { \l_chemformula_arrow_read_args_aux_ii:w } + { \l_chemformula_arrow_read_args_aux_iii: } } -% <- -\NewDocumentCommand \chemformula_arrow_left:w { O{}O{} } +\cs_new_nopar:Npn \l_chemformula_arrow_read_args_aux_ii:w [#1] { - \chemformula_determine_arrow_length:nn { #1 } { #2 } - \chemformula_tikz:nn { inner~sep=0, baseline=(chemformula_arrow_start.base) } - { - \chemformula_draw:xn { \l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl } - { - coordinate (chemformula_arrow_start) (0,0) - ++ (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) - node - [ - pos=.5, - above=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #1 } - node - [ - pos=.5, - below=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #2 } - } - \chemformula_draw:nn {} - { - (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim)++ - ( \l_chemformula_compound_sep_dim + \dim_use:N \l_chemformula_arrow_length_dim , 0) - } - } + \tl_set:Nn \l_chemformula_arrow_arg_ii_tl { #1 } + \l_chemformula_arrow_read_args_aux_iii: } -% <=> -\NewDocumentCommand \chemformula_arrow_equilibrium:w { O{}O{} } +\cs_new_nopar:Npn \l_chemformula_arrow_read_args_aux_iii: { - \chemformula_determine_arrow_length:nn { #1 } { #2 } - \chemformula_tikz:nn { inner~sep=0, baseline=(chemformula_arrow_start.base) } - { - \chemformula_draw:xn { -left~\l_chemformula_arrow_head_tl , \l_chemformula_arrow_style_tl } - { - coordinate (chemformula_arrow_start) (0,0) - ++ (\l_chemformula_compound_sep_dim,.429em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) - node - [ - pos=.5, - above=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #1 } - } - \chemformula_draw:xn { left~\l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl } - { - (chemformula_arrow_start) ++ - (\l_chemformula_compound_sep_dim,.2574em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) - node - [ - pos=.5, - below=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #2 } - } - \chemformula_draw:nn {} - { - (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) ++ - ( \l_chemformula_compound_sep_dim + \dim_use:N \l_chemformula_arrow_length_dim , 0) - } - } + % now we have both arguments do the actual drawing: + \prop_get:NVN \l_chemformula_arrows_code_prop + \l_chemformula_arrow_type_tl + \l_tmpb_tl + \chemformula_arrow_draw:V \l_tmpb_tl } -% <=>> -\NewDocumentCommand \chemformula_arrow_equilibrium_right:w { O{}O{} } +% get arrows (for the use in \ch to replace the symbol) +% #1: symbol +\cs_new_nopar:Npn \chemformula_arrows_get:n #1 { - \chemformula_determine_arrow_length:nn { #1 } { #2 } - \chemformula_tikz:nn { inner~sep=0, baseline=(chemformula_arrow_start.base) } - { - \chemformula_draw:xn { -left~\l_chemformula_arrow_head_tl , \l_chemformula_arrow_style_tl } - { - coordinate (chemformula_arrow_start) (0,0) - ++ (\l_chemformula_compound_sep_dim,.429em) ++ (0,\dim_use:N \l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) - node - [ - pos=.5, - above=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #1 } - } - \chemformula_draw:xn { left~\l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl } - { - (chemformula_arrow_start) ++ - (\l_chemformula_compound_sep_dim + \l_chemformula_arrow_shortage_dim,.2574em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim -2*\l_chemformula_arrow_shortage_dim , 0) - node - [ - pos=.5, - below=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #2 } - } - \chemformula_draw:nn {} - { - (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) ++ - ( \l_chemformula_compound_sep_dim + \dim_use:N \l_chemformula_arrow_length_dim , 0) - } - } + % first clear the arguments + \tl_clear:N \l_chemformula_arrow_arg_i_tl + \tl_clear:N \l_chemformula_arrow_arg_ii_tl + % then get the arrow type + \tl_set:Nn \l_chemformula_arrow_type_tl { #1 } + \l_chemformula_arrow_read_args:w } -% <<=> -\NewDocumentCommand \chemformula_arrow_equilibrium_left:w { O{}O{} } +% draw the arrows +\cs_new_nopar:Npn \chemformula_arrow_draw:n #1 { - \chemformula_determine_arrow_length:nn { #1 } { #2 } - \chemformula_tikz:nn { inner~sep=0, baseline=(chemformula_arrow_start.base) } + % prepare arrow code for drawing: + % TODO: flexible Pfeilspitzen, TikZ-Keys ermöglichen + \tl_set_rescan:Nnn \l_tmpc_tl { \char_set_catcode_letter:N \_ } { #1 } + % determine length of the arrow + \chemformula_determine_arrow_length:oo + { \l_chemformula_arrow_arg_i_tl } + { \l_chemformula_arrow_arg_ii_tl } + \chemformula_tikz:nf + { inner~sep=0, baseline=(chemformula_arrow_start.base) } { - \chemformula_draw:xn { -left~\l_chemformula_arrow_head_tl , \l_chemformula_arrow_style_tl } + % the coordinates + \chemformula_draw:xn + { \l_chemformula_arrow_style_tl } { coordinate (chemformula_arrow_start) (0,0) - ++ (\l_chemformula_compound_sep_dim + \l_chemformula_arrow_shortage_dim,.429em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim - 2*\l_chemformula_arrow_shortage_dim , 0) + ++ (\l_chemformula_compound_sep_dim,.3432em) + ++ (0,\l_chemformula_arrow_yshift_dim) + coordinate (cf_arrow_start) + ++ ( .5 * \dim_use:N \l_chemformula_arrow_length_dim , 0) + coordinate (cf_arrow_mid) + ++ ( .5 * \dim_use:N \l_chemformula_arrow_length_dim , 0) + coordinate (cf_arrow_end) + ++ (\l_chemformula_compound_sep_dim,0) + (cf_arrow_start) ++ (\l_chemformula_arrow_shortage_dim,0) + coordinate (cf_arrow_mid_start) + (cf_arrow_end) ++ (-\l_chemformula_arrow_shortage_dim , 0) + coordinate (cf_arrow_mid_end) + } + % the arrow labels: + \draw node [ - pos=.5, above=\l_chemformula_arrow_label_offset_dim, font=\l_chemformula_arrow_label_style_tl, butt~cap-butt~cap - ] { #1 } - } - \chemformula_draw:xn { left~\l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl } - { - (chemformula_arrow_start) ++ (\l_chemformula_compound_sep_dim,.2574em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) + ] at (cf_arrow_mid) { \l_chemformula_arrow_arg_i_tl } node [ - pos=.5, below=\l_chemformula_arrow_label_offset_dim, font=\l_chemformula_arrow_label_style_tl, butt~cap-butt~cap - ] { #2 } - } - \chemformula_draw:nn {} - { - (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) ++ - ( \l_chemformula_compound_sep_dim + \dim_use:N \l_chemformula_arrow_length_dim , 0) - } + ] at (cf_arrow_mid) { \l_chemformula_arrow_arg_ii_tl } + ; + \tl_use:N \l_tmpc_tl } } +\cs_generate_variant:Nn \chemformula_arrow_draw:n { V } +\cs_generate_variant:Nn \chemformula_determine_arrow_length:nn { oo } -% <> -\NewDocumentCommand \chemformula_arrow_both:w { O{}O{} } +% commands to declare arrows (can also be used by users): +% #1: symbol, #2: code +\NewDocumentCommand \DeclareChemArrow { mm } { - \chemformula_determine_arrow_length:nn { #1 } { #2 } - \chemformula_tikz:nn { inner~sep=0, baseline=(chemformula_arrow_start.base) } - { - \chemformula_draw:xn { -\l_chemformula_arrow_head_tl , \l_chemformula_arrow_style_tl } - { - coordinate (chemformula_arrow_start) (0,0) - ++ (\l_chemformula_compound_sep_dim,.441em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) - node - [ - pos=.5, - above=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #1 } - } - \chemformula_draw:xn { \l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl } - { - (chemformula_arrow_start) ++ - (\l_chemformula_compound_sep_dim,.2454em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++ - ( \dim_use:N \l_chemformula_arrow_length_dim , 0) - node - [ - pos=.5, - below=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] { #2 } - } - \chemformula_draw:nn {} - { - (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) ++ - ( \l_chemformula_compound_sep_dim + \dim_use:N \l_chemformula_arrow_length_dim , 0) - } - } + \prop_if_in:NnTF \l_chemformula_arrows_code_prop { #1 } + { \chemmacros_msg:nnxx { chemformula } { declare-arrow } { #1 } {} } + { \prop_put:Nnn \l_chemformula_arrows_code_prop { #1 } { #2 } } } + +\NewDocumentCommand \RenewChemArrow { mm } + { + \prop_if_in:NnTF \l_chemformula_arrows_code_prop { #1 } + { \prop_put:Nnn \l_chemformula_arrows_code_prop { #1 } { #2 } } + { \chemmacros_msg:nnxx { chemformula } { renew-arrow } { #1 } {} } + } + +\NewDocumentCommand \ShowChemArrow { m } + { + \prop_get:NnN \l_chemformula_arrows_code_prop { #1 } \l_tmpa_tl + \tl_to_str:N \l_tmpa_tl + } + +% declare arrows: +\DeclareChemArrow { <-> } { \draw[cf-cf] (cf_arrow_start) -- (cf_arrow_end) ; } +\DeclareChemArrow { -> } { \draw[-cf] (cf_arrow_start) -- (cf_arrow_end) ; } +\DeclareChemArrow { <- } { \draw[cf-] (cf_arrow_start) -- (cf_arrow_end) ; } +\DeclareChemArrow { <> } + { + \draw[-cf] ([yshift=.2ex]cf_arrow_start) -- ([yshift=.2ex]cf_arrow_end) ; + \draw[cf-,] ([yshift=-.2ex]cf_arrow_start) -- ([yshift=-.2ex]cf_arrow_end) ; + } +\DeclareChemArrow { <o> } + { + \draw[cf-cf] (cf_arrow_start) -- (cf_arrow_end) ; + \draw + (cf_arrow_mid) .. controls ++(-.9ex,-1.5ex) and + ++(.9ex,-1.5ex) .. (cf_arrow_mid) ; + } +\DeclareChemArrow { <=>> } + { + \draw[-left~cf] + ([yshift=.15ex]cf_arrow_start) -- ([yshift=.15ex]cf_arrow_end) ; + \draw[left~cf-] + ([yshift=-.15ex]cf_arrow_mid_start) -- ([yshift=-.15ex]cf_arrow_mid_end) ; + } +\DeclareChemArrow {<<=>} + { + \draw[-left~cf] + ([yshift=.15ex]cf_arrow_mid_start) -- ([yshift=.15ex]cf_arrow_mid_end) ; + \draw[left~cf-] + ([yshift=-.15ex]cf_arrow_start) -- ([yshift=-.15ex]cf_arrow_end) ; + } +\DeclareChemArrow { <=> } + { + \draw[-left~cf] + ([yshift=.15ex]cf_arrow_start) -- ([yshift=.15ex]cf_arrow_end) ; + \draw[left~cf-] + ([yshift=-.15ex]cf_arrow_start) -- ([yshift=-.15ex]cf_arrow_end) ; + } +\DeclareChemArrow { -/> } + { + \draw[-cf] (cf_arrow_start) -- (cf_arrow_end) ; + \draw (cf_arrow_mid) ++ (.2ex,.4ex) -- ++(-.4ex,-.8ex) ; + \draw (cf_arrow_mid) ++ (-.2ex,.4ex) -- ++(-.4ex,-.8ex) ; + } +\DeclareChemArrow { </- } + { + \draw[cf-] (cf_arrow_start) -- (cf_arrow_end) ; + \draw (cf_arrow_mid) ++ (.2ex,.4ex) -- ++(-.4ex,-.8ex) ; + \draw (cf_arrow_mid) ++ (.6ex,.4ex) -- ++(-.4ex,-.8ex) ; + } + %-----------------------------------------------------------------------------% % arrow customization \keys_define:nn { chemmacros / chemformula } @@ -534,7 +468,7 @@ arrow-ratio .tl_set:N = \l_chemformula_arrow_ratio_tl , label-offset .dim_set:N = \l_chemformula_arrow_label_offset_dim , compound-sep .dim_set:N = \l_chemformula_compound_sep_dim , - arrow-tips .tl_set:N = \l_chemformula_arrow_head_tl , +% arrow-tips .tl_set:N = \l_chemformula_arrow_head_tl , arrow-style .tl_set:N = \l_chemformula_arrow_style_tl , label-style .tl_set:N = \l_chemformula_arrow_label_style_tl } @@ -544,9 +478,15 @@ \NewDocumentCommand \chemformula_ch_aux_iii:w { > { \SplitList { ~ } } m } { \group_begin: + \cs_set_eq:NN \xspace \scan_stop: + \cs_set_nopar:Npn \[ { [ } + \cs_set_nopar:Npn \] { ] } \bool_set_true:N \l_chemformula_inside_ch_bool \tl_if_blank:oF { \g_chemformula_options_tl } - { \keys_set:no { chemmacros / chemformula } { \g_chemformula_options_tl } } + { + \keys_set:no { chemmacros / chemformula } + { \g_chemformula_options_tl } + } \tl_map_function:nN { #1 } \chemformula_input:n \chemformula_generate_arrows:N \l_chemformula_input_tl \chemformula_generate_name:N \l_chemformula_output_tl @@ -560,7 +500,6 @@ \cs_new:Nn \chemformula_ch:nn { \group_align_safe_begin: - \cs_set:Npn \xspace {} \leavevmode \IfNoValueTF { #1 } { \tl_gclear:N \g_chemformula_options_tl } @@ -583,7 +522,8 @@ \cs_new:Npn \chemformula_ch_aux_ii:w #1 & #2 \q_stop { - \tl_gput_right:Nn \g_chemformula_output_tl { \chemformula_ch_aux_iii:w { #1 } } + \tl_gput_right:Nn \g_chemformula_output_tl + { \chemformula_ch_aux_iii:w { #1 } } \quark_if_no_value:nF { #2 } { \tl_gput_right:Nn \g_chemformula_output_tl { & } @@ -610,43 +550,49 @@ %-----------------------------------------------------------------------------% % arrow generation & detection -\cs_new:Npn \chemformula_generate_arrows:n #1 +% make sure to look for <->, <=>> and <<=> first! +\cs_set:Npn \chemformula_generate_arrows:n #1 { \tl_set:No \l_tmpa_tl { #1 } - \tl_if_in:onT { \l_tmpa_tl } { <-> } - { \tl_replace_all:Nnn \l_tmpa_tl { <-> } { \chemformula_arrow_mesomeric:w } } - \tl_if_in:onT { \l_tmpa_tl } { -> } - { \tl_replace_all:Nnn \l_tmpa_tl { -> } { \chemformula_arrow_right:w } } - \tl_if_in:onT { \l_tmpa_tl } { <- } - { \tl_replace_all:Nnn \l_tmpa_tl { <- } { \chemformula_arrow_left:w } } - \tl_if_in:onT { \l_tmpa_tl } { glgw_l } - { \tl_replace_all:Nnn \l_tmpa_tl { glgw_l } { \chemformula_arrow_equilibrium_left:w } } - \tl_if_in:onT { \l_tmpa_tl } { <=>> } - { \tl_replace_all:Nnn \l_tmpa_tl { <=>> } { \chemformula_arrow_equilibrium_right:w } } - \tl_if_in:onT { \l_tmpa_tl } { <=> } - { \tl_replace_all:Nnn \l_tmpa_tl { <=> } { \chemformula_arrow_equilibrium:w } } - \tl_if_in:onT { \l_tmpa_tl } { <> } - { \tl_replace_all:Nnn \l_tmpa_tl { <> } { \chemformula_arrow_both:w } } + \tl_replace_all:Nnn \l_tmpa_tl { <-> } + { \chemformula_arrows_get:n { <-> } } + \tl_replace_all:Nnn \l_tmpa_tl { <=>> } + { \chemformula_arrows_get:n { <=>> } } + \tl_replace_all:Nnn \l_tmpa_tl { <<=> } + { \chemformula_arrows_get:n { <<=> } } + \prop_map_function:NN \l_chemformula_arrows_code_prop + \chemformula_replace_arrows:nn \tl_set_eq:NN \l_chemformula_output_tl \l_tmpa_tl } + +\bool_new:N \l_chemformula_arrow_already_replaced_bool +\cs_new:Npn \chemformula_replace_arrows:nn #1#2 + { + \tl_if_eq:nnT { #1 } { <-> } + { \bool_set_true:N \l_chemformula_arrow_already_replaced_bool } + \tl_if_eq:nnT { #1 } { <=>> } + { \bool_set_true:N \l_chemformula_arrow_already_replaced_bool } + \tl_if_eq:nnT { #1 } { <<=> } + { \bool_set_true:N \l_chemformula_arrow_already_replaced_bool } + \bool_if:NF \l_chemformula_arrow_already_replaced_bool + { + \tl_set_rescan:Nnn \l_tmpb_tl {} { #1 } + \exp_args:NNo \tl_replace_all:Nnn \l_tmpa_tl + { \l_tmpb_tl } { \chemformula_arrows_get:n { #1 } } + } + \bool_set_false:N \l_chemformula_arrow_already_replaced_bool + } \cs_generate_variant:Nn \chemformula_generate_arrows:n { N } \cs_new:Npn \chemformula_detect_arrows:n #1 { \bool_set_false:N \l_chemformula_is_arrow_bool - \tl_set:No \l_tmpa_tl { #1 } - \tl_if_in:onT { \l_tmpa_tl } { <-> } - { \bool_set_true:N \l_chemformula_is_arrow_bool } - \tl_if_in:onT { \l_tmpa_tl } { -> } - { \bool_set_true:N \l_chemformula_is_arrow_bool } - \tl_if_in:onT { \l_tmpa_tl } { <- } - { \bool_set_true:N \l_chemformula_is_arrow_bool } - \tl_if_in:onT { \l_tmpa_tl } { <=>> } - { \bool_set_true:N \l_chemformula_is_arrow_bool } - \tl_if_in:onT { \l_tmpa_tl } { glgw_l } - { \bool_set_true:N \l_chemformula_is_arrow_bool } - \tl_if_in:onT { \l_tmpa_tl } { <=> } - { \bool_set_true:N \l_chemformula_is_arrow_bool } + \prop_map_inline:Nn \l_chemformula_arrows_code_prop + { + \tl_set_rescan:Nnn \l_tmpa_tl {} { ##1 } + \tl_if_in:noT { #1 } { \l_tmpa_tl } + { \bool_set_true:N \l_chemformula_is_arrow_bool } + } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -654,7 +600,7 @@ \dim_new:N \l_chemformula_name_dim \cs_new:Npn \chemformula_name_cmpd:w - { \peek_meaning:NTF { ( } { \chemformula_name_cmpd_aux:w } { ! } } + { \peek_meaning:NTF ( { \chemformula_name_cmpd_aux:w } { ! } } \cs_new:Npn \chemformula_name_cmpd_aux:w (#1)(#2) { @@ -816,16 +762,26 @@ % behaviour in a charge \prop_new:N \l_chemformula_charge_prop -\prop_put:Nnn \l_chemformula_charge_prop { 0 } { \chemformula_charge_style:n { 0 } } -\prop_put:Nnn \l_chemformula_charge_prop { 1 } { \chemformula_charge_style:n { 1 } } -\prop_put:Nnn \l_chemformula_charge_prop { 2 } { \chemformula_charge_style:n { 2 } } -\prop_put:Nnn \l_chemformula_charge_prop { 3 } { \chemformula_charge_style:n { 3 } } -\prop_put:Nnn \l_chemformula_charge_prop { 4 } { \chemformula_charge_style:n { 4 } } -\prop_put:Nnn \l_chemformula_charge_prop { 5 } { \chemformula_charge_style:n { 5 } } -\prop_put:Nnn \l_chemformula_charge_prop { 6 } { \chemformula_charge_style:n { 6 } } -\prop_put:Nnn \l_chemformula_charge_prop { 7 } { \chemformula_charge_style:n { 7 } } -\prop_put:Nnn \l_chemformula_charge_prop { 8 } { \chemformula_charge_style:n { 8 } } -\prop_put:Nnn \l_chemformula_charge_prop { 9 } { \chemformula_charge_style:n { 9 } } +\prop_put:Nnn \l_chemformula_charge_prop { 0 } + { \chemformula_charge_style:n { 0 } } +\prop_put:Nnn \l_chemformula_charge_prop { 1 } + { \chemformula_charge_style:n { 1 } } +\prop_put:Nnn \l_chemformula_charge_prop { 2 } + { \chemformula_charge_style:n { 2 } } +\prop_put:Nnn \l_chemformula_charge_prop { 3 } + { \chemformula_charge_style:n { 3 } } +\prop_put:Nnn \l_chemformula_charge_prop { 4 } + { \chemformula_charge_style:n { 4 } } +\prop_put:Nnn \l_chemformula_charge_prop { 5 } + { \chemformula_charge_style:n { 5 } } +\prop_put:Nnn \l_chemformula_charge_prop { 6 } + { \chemformula_charge_style:n { 6 } } +\prop_put:Nnn \l_chemformula_charge_prop { 7 } + { \chemformula_charge_style:n { 7 } } +\prop_put:Nnn \l_chemformula_charge_prop { 8 } + { \chemformula_charge_style:n { 8 } } +\prop_put:Nnn \l_chemformula_charge_prop { 9 } + { \chemformula_charge_style:n { 9 } } \prop_put:Nnn \l_chemformula_charge_prop { + } { \chemformula_plus: } \prop_put:Nnn \l_chemformula_charge_prop { - } { \chemformula_minus: } \prop_put:Nnn \l_chemformula_charge_prop { . } { \chemformula_radical: } @@ -842,8 +798,10 @@ \prop_put:Nnn \l_chemformula_stoich_prop { 7 } { 7 } \prop_put:Nnn \l_chemformula_stoich_prop { 8 } { 8 } \prop_put:Nnn \l_chemformula_stoich_prop { 9 } { 9 } -\prop_put:Nnn \l_chemformula_stoich_prop { . } { { \l_chemformula_decimal_output_tl } } -\prop_put:Nnn \l_chemformula_stoich_prop { , } { { \l_chemformula_decimal_output_tl } } +\prop_put:Nnn \l_chemformula_stoich_prop { . } + { { \l_chemformula_decimal_output_tl } } +\prop_put:Nnn \l_chemformula_stoich_prop { , } + { { \l_chemformula_decimal_output_tl } } \prop_put:Nnn \l_chemformula_stoich_prop { / } { / } \prop_put:Nnn \l_chemformula_stoich_prop { _ } { _ } @@ -868,9 +826,14 @@ { \chemformula_tikz:nn { inner~sep=0, outer~sep=0 } { - \draw node[draw=none,minimum~height=1em,minimum~width=0] (chemformula-double-bond) at (0,0) {} ; - \draw[butt~cap-butt~cap] (chemformula-double-bond) ++ (0,-.0858em) -- ++( \l_chemformula_bond_dim ,0) ; - \draw[butt~cap-butt~cap] (chemformula-double-bond) ++ (0,-.2574em) -- ++( \l_chemformula_bond_dim ,0) ; + \draw node[draw=none,minimum~height=1em,minimum~width=0] + (chemformula-double-bond) at (0,0) {} ; + \draw[butt~cap-butt~cap] + (chemformula-double-bond) ++ (0,-.0858em) -- ++ + (\l_chemformula_bond_dim ,0) ; + \draw[butt~cap-butt~cap] + (chemformula-double-bond) ++ (0,-.2574em) -- ++ + (\l_chemformula_bond_dim ,0) ; } } @@ -878,10 +841,17 @@ { \chemformula_tikz:nn { inner~sep=0, outer~sep=0 } { - \draw node[draw=none,minimum~height=1em,minimum~width=0] (chemformula-triple-bond) at (0,0) {} ; - \draw[butt~cap-butt~cap] (chemformula-triple-bond) ++ (0,-.0429em) -- ++( \l_chemformula_bond_dim ,0) ; - \draw[butt~cap-butt~cap] (chemformula-triple-bond) ++ (0,-.1716em) -- ++( \l_chemformula_bond_dim ,0) ; - \draw[butt~cap-butt~cap](chemformula-triple-bond) ++ (0,-.3003em) -- ++( \l_chemformula_bond_dim ,0) ; + \draw node[draw=none,minimum~height=1em,minimum~width=0] + (chemformula-triple-bond) at (0,0) {} ; + \draw[butt~cap-butt~cap] + (chemformula-triple-bond) ++ (0,-.0429em) -- ++ + (\l_chemformula_bond_dim ,0) ; + \draw[butt~cap-butt~cap] + (chemformula-triple-bond) ++ (0,-.1716em) -- ++ + (\l_chemformula_bond_dim ,0) ; + \draw[butt~cap-butt~cap] + (chemformula-triple-bond) ++ (0,-.3003em) -- ++ + (\l_chemformula_bond_dim ,0) ; } } @@ -906,8 +876,10 @@ \bool_set_true:N \l_chemformula_sub_bool % clean up wrong input \tl_set:Nn \l_tmpc_tl { #1 } - \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_single_bond: } { \chemformula_minus: } - \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_triple_bond: } {\chemformula_plus: } + \tl_replace_all:Nnn \l_tmpc_tl + { \chemformula_single_bond: } { \chemformula_minus: } + \tl_replace_all:Nnn \l_tmpc_tl + { \chemformula_triple_bond: } {\chemformula_plus: } \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_adduct: } { . } \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_star_adduct: } { * } % measure width and save it @@ -924,8 +896,14 @@ } \dim_set:Nn \l_chemformula_subscript_dim { -\box_wd:N \l_tmpa_box } \prop_get:NnNTF \l_chemformula_charge_prop { #1 } \l_tmpa_tl - { \exp_args:NNo \hbox_set:Nn \l_tmpb_box { $ ^ { \chemformula_charge_style:n { \l_tmpa_tl } } $ } } - { \exp_args:NNo \hbox_set:Nn \l_tmpb_box { $ ^ { \chemformula_charge_style:n { \l_tmpc_tl } } $ } } + { + \exp_args:NNo \hbox_set:Nn \l_tmpb_box + { $ ^ { \chemformula_charge_style:n { \l_tmpa_tl } } $ } + } + { + \exp_args:NNo \hbox_set:Nn \l_tmpb_box + { $ ^ { \chemformula_charge_style:n { \l_tmpc_tl } } $ } + } \dim_set:Nn \l_chemformula_subscript_compare_dim { -\box_wd:N \l_tmpb_box } \box_clear:N \l_tmpa_box \box_clear:N \l_tmpb_box @@ -966,17 +944,26 @@ \bool_set_true:N \l_chemformula_sup_bool % clean up wrong input \tl_set:Nn \l_tmpc_tl { #1 } - \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_single_bond: } { \chemformula_minus: } + \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_single_bond: } + { \chemformula_minus: } \tl_replace_all:Nnn \l_tmpc_tl { - } { \chemformula_minus: } - \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_triple_bond: } { \chemformula_plus: } + \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_triple_bond: } + { \chemformula_plus: } \tl_replace_all:Nnn \l_tmpc_tl { + } { \chemformula_plus: } - \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_adduct: } { \chemformula_radical: } + \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_adduct: } + { \chemformula_radical: } \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_star_adduct: } { * } \tl_replace_all:Nnn \l_tmpc_tl { . } { \chemformula_radical: } % measure width and save it \prop_get:NnNTF \l_chemformula_charge_prop { #1 } \l_tmpa_tl - { \exp_args:NNo \hbox_set:Nn \l_tmpa_box { $ ^ { \chemformula_charge_style:n { \l_tmpa_tl } } $ } } - { \exp_args:NNo \hbox_set:Nn \l_tmpa_box { $ ^ { \chemformula_charge_style:n { \l_tmpc_tl } } $ } } + { + \exp_args:NNo \hbox_set:Nn \l_tmpa_box + { $ ^ { \chemformula_charge_style:n { \l_tmpa_tl } } $ } + } + { + \exp_args:NNo \hbox_set:Nn \l_tmpa_box + { $ ^ { \chemformula_charge_style:n { \l_tmpc_tl } } $ } + } \dim_set:Nn \l_chemformula_supscript_dim { -\box_wd:N \l_tmpa_box } \box_clear:N \l_tmpa_box @@ -1089,7 +1076,6 @@ { \tl_set_rescan:Nnn \l_chemformula_tmpa_tl { -% \char_set_catcode_letter:N \_ \char_set_catcode_letter:N \{ \char_set_catcode_letter:N \} \char_set_catcode_letter:N \\ @@ -1099,12 +1085,10 @@ \chemformula_input_escape_text:o { \l_chemformula_tmpa_tl } \chemformula_input_escape_math:n { #1 } \chemformula_input_stoich:n { #1 } - % need to take care of <<=> arrow - \tl_if_in:onT { \l_chemformula_tmpa_tl } { <<=> } - { \tl_replace_all:Nnn \l_chemformula_tmpa_tl { <<=> } { glgw_l } } \chemformula_clean_chem_macros:o { \l_chemformula_tmpa_tl } - \chemformula_input_cmpd:oN { \l_chemformula_tmpa_tl } \l_chemformula_input_tl - \chemformula_input_arrow:o { \l_chemformula_tmpa_tl } + \chemformula_input_cmpd:oN + { \l_chemformula_tmpa_tl } \l_chemformula_input_tl + \chemformula_input_arrow:n { #1 } \chemformula_input_name:n { #1 } \chemformula_input_plus:n { #1 } \chemformula_input_up:n { #1 } @@ -1133,7 +1117,8 @@ \tl_set_rescan:Nno \l_chemformula_stoich_tl { \ExplSyntaxOn } { \l_chemformula_stoich_tl } - \exp_args:No \chemformula_parse_stoich:n { \l_chemformula_stoich_tl } + \exp_args:No \chemformula_parse_stoich:n + { \l_chemformula_stoich_tl } } } { \tl_clear:N \l_chemformula_stoich_tl } @@ -1159,7 +1144,10 @@ } \cs_new:Npn \chemformula_parse_stoich_frac:w #1/#2 \q_nil - { \tl_put_right:Nn \l_chemformula_input_tl { \chemformula_frac:nn { #1 } { #2 } } } + { + \tl_put_right:Nn \l_chemformula_input_tl + { \chemformula_frac:nn { #1 } { #2 } } + } \cs_new:Npn \chemformula_parse_stoich_misc_frac:w #1_#2/#3 \q_nil { @@ -1218,7 +1206,8 @@ } } { - \tl_put_right:Nn #2 { \skip_horizontal:N \l_chemformula_stoich_space_dim } + \tl_put_right:Nn #2 + { \skip_horizontal:N \l_chemformula_stoich_space_dim } \tl_clear:N \l_chemformula_stoich_tl } } @@ -1269,14 +1258,21 @@ \exp_args:Nx \tl_if_in:nnT { \tl_head:V \l_tmpa_tl } { ^ } { \bool_set_true:N \l_chemformula_first_is_sup_bool } \tl_if_in:VnT \l_tmpa_tl { ^ } - { \tl_replace_all:Nnn \l_tmpa_tl { ^ } { \chemformula_chief_supscript:n } } + { + \tl_replace_all:Nnn \l_tmpa_tl { ^ } + { \chemformula_chief_supscript:n } + } \tl_if_in:VnT \l_tmpa_tl { _ } - { \tl_replace_all:Nnn \l_tmpa_tl { _ } { \chemformula_chief_subscript:n } } + { + \tl_replace_all:Nnn \l_tmpa_tl { _ } + { \chemformula_chief_subscript:n } + } \int_zero:N \l_chemformula_count_tokens_int \tl_map_inline:Nn \l_tmpa_tl { \int_incr:N \l_chemformula_count_tokens_int - \int_compare:nTF { \l_chemformula_count_tokens_int = \tl_length:N \l_tmpa_tl } + \int_compare:nTF + { \l_chemformula_count_tokens_int = \tl_length:N \l_tmpa_tl } { \tl_if_eq:nnTF { ##1 } { + } { @@ -1528,7 +1524,10 @@ { \dim_set:Nn \l_chemformula_subscript_shift_additional_dim { #1 } \dim_set:Nn \l_chemformula_subscript_shift_dim - { \l_chemformula_subscript_shift_default_dim + \l_chemformula_subscript_shift_additional_dim } + { + \l_chemformula_subscript_shift_default_dim + + \l_chemformula_subscript_shift_additional_dim + } } , subscript-vshift .default:n = 0pt , subscript-style .choice: , @@ -1610,13 +1609,14 @@ VERSION HISTORY - bugfix: escaped text recognizes space by ~ again - * in superscript now gives excited state - new arrow type <> +2012/02/19 - version 3.1 - new functions in the chemmacros package + - new arrow types -/>, </- and <o> + - new commands \DeclareChemArrow, \RenewChemArrow and + \ShowChemArrow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO - Addukte: Zahlen nach * und . automatisch erkennen? - allow fractions in subscripts: _{$\frac{1}{2}$} ? - optionale argumente von \\ nach außen weiterreichen? -- vertikaler shift für superskripte? -- the explicit definition of each arrow on its own is inefficient. - also these definitions abuse the `xparse' command \NewDocumentCommand - for internal commands => needs to be taken care of
\ No newline at end of file +- vertikaler shift für superskripte?
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty index fcba2944cd4..01888f2ff44 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/02/10 - % +% - 2012/02/19 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -27,10 +27,15 @@ % - - % % - The Current Maintainer of this work is Clemens Niederberger. - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\RequirePackage{ expl3 , xparse , l3keys2e , xfrac , siunitx , tikz , mathtools , environ , scrlfile , etoolbox , bm } +\RequirePackage{ expl3 , xparse , l3keys2e , xfrac , siunitx } +\RequirePackage{ tikz , mathtools , environ , scrlfile , etoolbox , bm } \usetikzlibrary{calc,arrows} -\ProvidesExplPackage {chemmacros} {2012/02/10} {3.0d} {macros and commands for chemists} +\ProvidesExplPackage + {chemmacros} + {2012/02/19} + {3.1} + {macros and commands for chemists} \@ifpackageloaded { chemformula } {} { \RequirePackage { chemformula } } @@ -54,9 +59,13 @@ \bool_new:N \l_chemmacros_chemfig_bool \bool_new:N \l_chemmacros_ghsystem_bool \bool_set_true:N \l_chemmacros_ghsystem_bool +\bool_new:N \l_chemmacros_iupac_restricted_bool +\bool_new:N \l_chemmacros_iupac_strict_bool +\bool_new:N \l_chemmacros_in_document_bool \AtBeginDocument { + \bool_set_true:N \l_chemmacros_in_document_bool \@ifpackageloaded { chemstyle } { \bool_set_true:N \l_chemmacros_chemstyle_bool } { \bool_set_false:N \l_chemmacros_chemstyle_bool } @@ -84,6 +93,7 @@ % method => use `chemformula' or `mhchem' % strict => errors or warnings % synchronize => let particles et.al. adapt chemformula's font selection +% iupac => behaviour of nomenclature commands % version=1 => compatibility for documents set with v1.* \bool_new:N \l_chemmacros_strict_bool @@ -101,7 +111,6 @@ { \bool_set_false:N \l_chemmacros_circled_chem_bool } , circletype / chem .code:n = { \bool_set_true:N \l_chemmacros_circled_chem_bool } , - circletype .default:n = chem , circled .choice: , circled / none .code:n = { @@ -118,33 +127,27 @@ \bool_set_true:N \l_chemmacros_circled_bool \bool_set_false:N \l_chemmacros_circled_formal_bool } , - circled .default:n = formal , + circled .default:n = all , detect-bold .bool_set:N = \l_chemmacros_detect_bold_bool , detect-bold .default:n = true , - EZ .choice: , - EZ / cool .code:n = - { \bool_set_true:N \l_chemmacros_EZ_cool_bool } , - EZ / chemmacros .code:n = - { \bool_set_false:N \l_chemmacros_EZ_cool_bool } , - EZ .default:n = chemmacros , + EZ .code:n = + \chemmacros_msg:nnxx { chemmacros } { option-deprecated } { EZ } {} , german .bool_set:N = \l_chemmacros_german_bool , german .default:n = true , ghsystem .bool_set:N = \l_chemmacros_ghsystem_bool , ghsystem .default:n = true , - ngerman .bool_set:N = \l_chemmacros_german_bool , - ngerman .default:n = true , method .choice: , method / chemformula .code:n = \bool_set_false:N \l_chemmacros_use_mhchem_bool , method / mhchem .code:n = \bool_set_true:N \l_chemmacros_use_mhchem_bool , - method .default:n = chemformula , + ngerman .bool_set:N = \l_chemmacros_german_bool , + ngerman .default:n = true , Nu .choice: , Nu / mathspec .code:n = \bool_set_true:N \l_chemmacros_Nu_mathspec_bool , Nu / chemmacros .code:n = \bool_set_false:N \l_chemmacros_Nu_mathspec_bool , - Nu .default:n = chemmacros , strict .bool_set:N = \l_chemmacros_strict_bool , strict .default:n = true , synchronize .choice: , @@ -152,6 +155,16 @@ \cs_set_eq:NN \chemmacros_inner_font: \chemformula_font_inner: , synchronize / false .code:n = \cs_set:Nn \chemmacros_inner_font: {} , synchronize .default:n = true , + iupac .choice: , + iupac / restricted .code:n = + \bool_set_true:N \l_chemmacros_iupac_restricted_bool + \bool_set_false:N \l_chemmacros_iupac_strict_bool , + iupac / auto .code:n = + \bool_set_false:N \l_chemmacros_iupac_restricted_bool + \bool_set_false:N \l_chemmacros_iupac_strict_bool , + iupac / strict .code:n = + \bool_set_false:N \l_chemmacros_iupac_restricted_bool + \bool_set_true:N \l_chemmacros_iupac_strict_bool , xspace .bool_set:N = \l_chemmacros_xspace_bool , xspace .default:n = true , version .choice: , @@ -203,20 +216,29 @@ See~the~documentation~for~more~information. } +\msg_set:nnn { chemmacros } { option-deprecated } + { The~option~#1~is~deprecated.~I~will~ignore~it. } + +\msg_set:nnn { chemmacros } { command-deprecated } + { + The~command~\token_to_str:N #1 \c_space_tl is~deprecated.~Use~ + \token_to_str:N #2 \c_space_tl instead. + } + \msg_set:nnnn { chemmacros } { declare-particle } { The~command~sequence~ \token_to_str:N #1 \c_space_tl is~already~defined. } { - You've~tried~to~define~a~particle~with~\token_to_str:N \DeclareChemParticle ,~but - ~the~command~sequence~ \token_to_str:N #1 \c_space_tl already~exists.~Choose~ - another~name. + You've~tried~to~define~a~particle~with~\token_to_str:N \DeclareChemParticle, + ~but~the~command~sequence~ \token_to_str:N #1 \c_space_tl already~exists. + ~Choose~another~name. } \msg_set:nnnn { chemmacros } { renew-particle } { The~particle~ \token_to_str:N #1 \c_space_tl is~not~defined. } { - You've~tried~to~renew~the~particle~\token_to_str:N #1 , but~it~doesn't~ + You've~tried~to~renew~the~particle~\token_to_str:N #1 ,~but~it~doesn't~ exist. } @@ -225,18 +247,35 @@ The~command~sequence~ \token_to_str:N #1 \c_space_tl is~already~defined. } { - You've~tried~to~define~a~particle~with~\token_to_str:N \DeclareChemPhase ,~but - ~the~command~sequence~ \token_to_str:N #1 \c_space_tl already~exists.~Choose~ - another~name. + You've~tried~to~define~a~particle~with~\token_to_str:N \DeclareChemPhase , + ~but~the~command~sequence~ \token_to_str:N #1 \c_space_tl already~exists. + ~Choose~another~name. } \msg_set:nnnn { chemmacros } { renew-phase } { The~phase~ \token_to_str:N #1 \c_space_tl is~not~defined. } { - You've~tried~to~renew~the~phase~\token_to_str:N #1 , but~it~doesn't~ + You've~tried~to~renew~the~phase~\token_to_str:N #1 ,~but~it~doesn't~ exist. } +\msg_set:nnnn { chemmacros } { declare-iupac } + { + The~iupac~naming~command~ \token_to_str:N #1 \c_space_tl is~already~defined. + } + { + You've~tried~to~define~a~iupac~naming~command~with~\token_to_str:N + \DeclareChemIUPAC,~but~the~iupac~command~ \token_to_str:N #1 \c_space_tl + already~exists.~Choose~another~name~or~use~\token_to_str:N \RenewChemIUPAC . + } + +\msg_set:nnnn { chemmacros } { renew-iupac } + { The~iupac~naming~command~ \token_to_str:N #1 \c_space_tl is~not~defined. } + { + You've~tried~to~renew~the~iupac~command~\token_to_str:N #1 ,~but~it~doesn't~ + exist.~Use~\token_to_str:N \DeclareChemIUPAC \c_space_tl instead . + } + \msg_set:nnn { chemmacros } { ox } { \token_to_str:N \ox \c_space_tl : ~ #1 ~ \msg_line_context: . @@ -259,18 +298,18 @@ work~properly~\msg_line_context: . } -\msg_set:nnn { chemmacros } { setnewstate } +\msg_set:nnn { chemmacros } { DeclareChemState } { The~state~ \exp_after:wN \token_to_str:N \cs:w #1 \cs_end: \c_space_tl already~exists.~You~need~to~use~ - \token_to_str:N \renewstate \c_space_tl to~alter~it. + \token_to_str:N \RenewChemState \c_space_tl to~alter~it. } -\msg_set:nnn { chemmacros } { renewstate } +\msg_set:nnn { chemmacros } { RenewChemState } { The~state~\exp_after:wN \token_to_str:N \cs:w #1 \cs_end: \c_space_tl isn't~set~up~yet.~You~need~to~use~ - \token_to_str:N \setnewstate \c_space_tl to~create~it. + \token_to_str:N \DeclareChemState \c_space_tl to~create~it. } % --------------------------------------------------------------------------- % @@ -382,22 +421,29 @@ % --------------------------------------------------------------------------- % % transition state symbol +\cs_new_nopar:Npn \chemmacros_transition_state_aux: + { + \text + { + \skip_horizontal:n { .1ex } + \hbox_overlap_right:n + { \rule { .6ex } { 0pt } \rule { .05ex } { 1.3ex } } + \hbox_overlap_right:n { \rule [ .4ex ] { 1.3ex } { .05ex } } + \rule [ .85ex ] { 1.3ex } { .05ex } + \skip_horizontal:n { .1ex } + } + } + \cs_new_nopar:Npn \transitionstatesymbol - { \ensuremath { \chemmacros_transitionstatesymbol: } } -\cs_new_nopar:Npn \chemmacros_transitionstatesymbol: - { \mathpalette \chemmacros_transitionstatesymbol_aux: = } -\cs_new_nopar:Npn \chemmacros_transitionstatesymbol_aux: #1#2 { - \ooalign + \ensuremath { - \tex_hfil:D - $#1\mid$ - \tex_hfil:D - \tex_cr:D - \tex_hfil:D - $#1#2$ - \tex_hfil:D - \tex_cr:D + \mathchoice + { \displaystyle } + { \textstyle } + { \scriptstyle } + { \scriptscriptstyle } + \chemmacros_transition_state_aux: } } @@ -412,7 +458,8 @@ \cs_new:Nn \chemmacros_text:n { \mode_if_math:TF { \text { #1 } } { #1 } } -% add a possibility to let chemformula use the chemformula with method=chemformula, too +% add a possibility to let chemformula use the chemformula +% with method=chemformula, too \tl_new:N \l_chemmacros_chemformula_tl \cs_new:Nn \chemmacros_chemformula:n { @@ -611,8 +658,10 @@ \bool_if:NTF \l_chemmacros_use_mhchem_bool { \cs_new_nopar:Npn \Hpl { \chemmacros_atom:n { H } \pch \chemmacros_xspace: } - \cs_new_nopar:Npn \Hyd { \chemmacros_atom:n { OH } \mch \chemmacros_xspace: } - \cs_new_nopar:Npn \HtO { \chemmacros_chemformula:n { H3O } \pch \chemmacros_xspace: } + \cs_new_nopar:Npn \Hyd + { \chemmacros_atom:n { OH } \mch \chemmacros_xspace: } + \cs_new_nopar:Npn \HtO + { \chemmacros_chemformula:n { H3O } \pch \chemmacros_xspace: } \cs_new_nopar:Npn \El { \chemmacros_atom:n { E } \pch \chemmacros_xspace: } } { @@ -662,7 +711,9 @@ \bool_if:NTF \l_chemmacros_chemfig_bool { \bool_if:NTF \l_chemmacros_elpair_dots_bool - { { \chemmacros_inner_font: #1 \Lewis { 0: , { \vphantom { #1 } } } } } + { + { \chemmacros_inner_font: #1 \Lewis { 0: , { \vphantom { #1 } } } } + } { { \chemmacros_inner_font: #1 \Lewis { 0 , \vphantom { #1 } } } } } { @@ -692,16 +743,83 @@ elpair .default:n = dots } -% --------------------------------------------------------------------------- % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% IUPAC +\prop_new:N \l_chemmacros_iupac_prop + +\NewDocumentCommand \DeclareChemIUPAC { mm } + { + \tl_set_rescan:Nnn \l_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 } + \tl_set:Nf \l_tmpa_tl { \tl_tail:V \l_tmpa_tl } + \prop_if_in:NoTF \l_chemmacros_iupac_prop { \l_tmpa_tl } + { \chemmacros_msg:nnxx { chemmacros } { declare-iupac } { #1 } { } } + { \prop_put:Non \l_chemmacros_iupac_prop { \l_tmpa_tl } { #2 } } + \chemmacros_make_iupac: + } + +\NewDocumentCommand \RenewChemIUPAC { mm } + { + \tl_set_rescan:Nnn \l_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 } + \tl_set:Nf \l_tmpa_tl { \tl_tail:V \l_tmpa_tl } + \prop_if_in:NoTF \l_chemmacros_iupac_prop { \l_tmpa_tl } + { \prop_put:Non \l_chemmacros_iupac_prop { \l_tmpa_tl } { #2 } } + { \chemmacros_msg:nnxx { chemmacros } { renew-iupac } { #1 } { } } + \chemmacros_make_iupac: + } + +\cs_new_nopar:Npn \chemmacros_make_iupac: + { + \bool_if:NT \l_chemmacros_in_document_bool + { + \bool_if:NTF \l_chemmacros_inside_iupac_bool + { + \prop_map_inline:Nn \l_chemmacros_iupac_prop + { \cs_set_protected_nopar:cpn { ##1 } { ##2 } } + } + { + \bool_if:NF \l_chemmacros_iupac_restricted_bool + { + \bool_if:NTF \l_chemmacros_iupac_strict_bool + { + \prop_map_inline:Nn \l_chemmacros_iupac_prop + { \cs_set_protected_nopar:cpn { ##1 } { ##2 } } + } + { + \prop_map_inline:Nn \l_chemmacros_iupac_prop + { + \cs_if_exist:cF { ##1 } + { \cs_set_protected_nopar:cpn { ##1 } { ##2 } } + } + } + } + } + } + } + +\AtBeginDocument { \chemmacros_make_iupac: } + % stereo descriptors and other nomenclature commands % Cahn-Ingold-Prelog -\cs_new_protected_nopar:Npn \Rcip { \textit { (R) } } -\cs_new_protected_nopar:Npn \Scip { \textit { (S) } } -\cs_new_protected_nopar:Npn \cip #1 { \textit { (#1) } } +\NewDocumentCommand \cip { m } { \textit { (#1) } } + +\cs_new_protected_nopar:Npn \Rcip + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \Rcip } { \R } + \cip { R } + } +\cs_new_protected_nopar:Npn \Scip + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \Scip } { \S } + \cip { S } + } +\DeclareChemIUPAC \R { \cip { R } } +\DeclareChemIUPAC \S { \cip { S } } % TikZ needs : to be other \ExplSyntaxOff -\NewDocumentCommand\Sconf { O { S } }% +\NewDocumentCommand\Sconf{O{S}} {% \tikz[baseline=(a.base),text height=1.5ex,text depth=.25ex] { @@ -710,61 +828,55 @@ }% } -\NewDocumentCommand \Rconf { O { R } }% +\NewDocumentCommand\Rconf{O{R}} {% \tikz[baseline=(a.base),text height=1.5ex,text depth=.25ex] { \node(a) {#1} ; \draw[<-,thick,rotate=90] ($(a.center)+(20:.8em)$) arc (20:340:.8em) ; }% - }% + } \ExplSyntaxOn % E(ntgegen)/Z(usammen) -\AtBeginDocument - { - \bool_if:NTF \l_chemmacros_EZ_cool_bool - { - \cs_new_protected_nopar:Npn \Ent { \textit { (E) } } - \cs_new_protected_nopar:Npn \Zus { \textit { (Z) } } - } - { - \cs_if_free:NTF \E - { \cs_new_protected_nopar:Npn \E { \textit { (E) } } } - { \cs_set_protected_nopar:Npn \E { \textit { (E) } } } - \cs_new_protected_nopar:Npn \Z { \textit { (Z) } } - } - } +\DeclareChemIUPAC \E { \textit { (E) } } +\DeclareChemIUPAC \Z { \textit { (Z) } } % cis/trans & tert -\AtBeginDocument - { - \cs_if_free:NTF \cis - { \cs_new_protected_nopar:Npn \cis { \textit { cis } } } - { \cs_set_protected_nopar:Npn \cis { \textit { cis } } } - \cs_if_free:NTF \trans - { \cs_new_protected_nopar:Npn \trans { \textit { trans } } } - { \cs_set_protected_nopar:Npn \trans { \textit { trans } } } - } -\cs_new_protected_nopar:Npn \tert { \textit { tert } } +\DeclareChemIUPAC \cis { \textit{ cis } } +\DeclareChemIUPAC \trans { \textit { trans } } +\DeclareChemIUPAC \tert { \textit { tert } } % Fischer -\cs_new_protected_nopar:Npn \Dfi { \textsc { d } } -\cs_new_protected_nopar:Npn \Lfi { \textsc { l } } +\cs_set_protected_nopar:Npn \Dfi + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \Dfi } { \D } + \textsc { d } + } +\cs_set_protected_nopar:Npn \Lfi + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \Lfi } { \L } + \textsc { l } + } +\DeclareChemIUPAC \D { \textsc { d } } +\DeclareChemIUPAC \L { \textsc { l } } % ortho/meta/para -\cs_new_protected_nopar:Npn \ortho { \textsl { o } } -\cs_new_protected_nopar:Npn \meta { \textsl { m } } -\cs_new_protected_nopar:Npn \para { \textsl { p } } +\DeclareChemIUPAC \ortho { \textsl { o } } +\DeclareChemIUPAC \meta { \textsl { m } } +\DeclareChemIUPAC \para { \textsl { p } } % syn/anti -\cs_new_protected_nopar:Npn \syn { \textit { syn } } -\cs_new_protected_nopar:Npn \anti { \textit { anti } } +\DeclareChemIUPAC \syn { \textit { syn } } +\DeclareChemIUPAC \anti { \textit { anti } } % \iupac (basically the same as bpchem's \IUPAC) % - allows multiple breaking points as compound names can get really long and % especially in multicolumn documents can span more than two lines % - add a (very) little space after the hyphen +% - enables all naming commands regardless if they're definied otherwise or not \cs_new_protected:Nn \chemmacros_allow_hyphens: { \tex_penalty:D \c_ten_thousand \skip_horizontal:n { \c_zero_dim } } \cs_new_protected:Nn \chemmacros_break_point_hyphen: @@ -776,9 +888,13 @@ \chemmacros_allow_hyphens: } +\bool_new:N \l_chemmacros_inside_iupac_bool + \cs_new_protected:Nn \chemmacros_iupac:n { \group_begin: + \bool_set_true:N \l_chemmacros_inside_iupac_bool + \chemmacros_make_iupac: \tex_ignorespaces:D \cs_set_eq:NN \- \chemmacros_break_point_hyphen: \cs_set_eq:NN \| \chemmacros_break_point: @@ -793,7 +909,7 @@ \cs_set_protected_nopar:Npx \- { \exp_not:o { \- } } \cs_set_eq:NN \@dischyph \- -\cs_set_eq:NN \iupac \chemmacros_iupac:n +\cs_set_eq:NN \iupac \chemmacros_iupac:n % latin phrases \AtBeginDocument @@ -812,9 +928,15 @@ % --------------------------------------------------------------------------- % % acid/base \cs_new_nopar:Npn \pH - { \mbox { \chemmacros_detect_bold:n { \textsl { p } H } } \chemmacros_xspace: } + { + \mbox { \chemmacros_detect_bold:n { \textsl { p } H } } + \chemmacros_xspace: + } \cs_new_nopar:Npn \pOH - { \mbox { \chemmacros_detect_bold:n { \textsl { p } OH } } \chemmacros_xspace: } + { + \mbox { \chemmacros_detect_bold:n { \textsl { p } OH } } + \chemmacros_xspace: + } \NewDocumentCommand \p { m } { \mbox @@ -924,10 +1046,10 @@ % --------------------------------------------------------------------------- % % substituents -% \R[<sign>]{<subscript>} +% \Rad[<sign>]{<subscript>} \char_set_catcode_math_subscript:N \@ -\NewDocumentCommand \R { o g } +\NewDocumentCommand \Rad { o g } { \chemmacros_atom:n { @@ -1354,11 +1476,17 @@ \tikz[remember~picture,overlay] { \chemmacros_tikz_draw:f { \tl_use:N \l_chemmacros_redox_tikz_tl } - ($(\l_chemmacros_redox_begin_tl . \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim)$) + ($ + (\l_chemmacros_redox_begin_tl . + \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim) + $) -- ++(0,\l_chemmacros_redox_shift_tl * \l_chemmacros_redox_dist_dim) -| node [pos=.25,\l_chemmacros_redox_anchor_tl] { { #4 } } - ($(\l_chemmacros_redox_end_tl . \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim)$) ; + ($ + (\l_chemmacros_redox_end_tl . + \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim) + $) ; } } @@ -1766,10 +1894,10 @@ \tl_set:Nn \l_chemmacros_reaction_lorname_tl { #1 ~ } } -% \newreaction[<keyval>]{<name>}{<type>} +% \DeclareChemReaction[<keyval>]{<name>}{<type>} \bool_if:NF \l_chemmacros_version_one_bool { - \NewDocumentCommand \newreaction { o m m } + \NewDocumentCommand \DeclareChemReaction { o m m } { \cs_if_exist:cTF { #2 } { \msg_error:nnx { chemmacros } { already-defined } { #2 } } @@ -1834,6 +1962,12 @@ } \ignorespaces } + \cs_set:Npn \newreaction + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \newreaction } { \DeclareChemReaction } + \DeclareChemReaction + } } \cs_new:Npn \chemmacros_equation_chemformula:n #1 @@ -1847,8 +1981,8 @@ % predefined: \bool_if:NF \l_chemmacros_version_one_bool { - \newreaction [ star ] { reaction } { equation } - \newreaction [ star ] { reactions } { align } + \DeclareChemReaction [ star ] { reaction } { equation } + \DeclareChemReaction [ star ] { reactions } { align } } % --------------------------------------------------------------------------- % @@ -1998,10 +2132,10 @@ \l_chemmacros_thermod_delta_default_tl } -% \setnewstate[<keyval>]{<name>}{<symbol>}{<unit>} +% \DeclareChemState[<keyval>]{<name>}{<symbol>}{<unit>} \bool_if:NF \l_chemmacros_version_one_bool { - \cs_new:Npn \setnewstate + \cs_new:Npn \DeclareChemState { \bool_set_false:N \l_chemmacros_renewstate_bool \chemmacros_setnewstate_reset: @@ -2009,8 +2143,8 @@ { \setnewstate_aux_i:n } { \setnewstate_aux_ii:nnn } } -% \renewstate[<keyval>]{<name>}{<symbol>}{<unit>} - \cs_new:Npn \renewstate +% \RenewChemState[<keyval>]{<name>}{<symbol>}{<unit>} + \cs_new:Npn \RenewChemState { \bool_set_true:N \l_chemmacros_renewstate_bool \chemmacros_setnewstate_reset: @@ -2018,6 +2152,18 @@ { \setnewstate_aux_i:n } { \setnewstate_aux_ii:nnn } } + \cs_set:Npn \setnewstate + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \setnewstate } { \DeclareChemState } + \DeclareChemState + } + \cs_set:Npn \renewstate + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \renewstate } { \RenewChemState } + \RenewChemState + } } \cs_new_nopar:Npn \chemmacros_setnewstate_reset: @@ -2152,10 +2298,10 @@ % predefined: \bool_if:NF \l_chemmacros_version_one_bool { - \setnewstate {Enthalpy} {H} {\kilo\joule\per\mole} - \setnewstate [ delta=false, subscript-left=false ] {Entropy} + \DeclareChemState {Enthalpy} {H} {\kilo\joule\per\mole} + \DeclareChemState [ delta=false, subscript-left=false ] {Entropy} {S} {\joule\per\kelvin\per\mole} - \setnewstate {Gibbs} {G} {\kilo\joule\per\mole} + \DeclareChemState {Gibbs} {G} {\kilo\joule\per\mole} } % --------------------------------------------------------------------------- % @@ -2453,9 +2599,10 @@ \keys_define:nn { chemmacros / orbital / s } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_s_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_s_phase_bool } , - phase .default:n = + , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_s_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_s_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_s_scale_tl , color .tl_set:N = \l_chemmacros_orbital_s_color_tl } @@ -2501,8 +2648,10 @@ \keys_define:nn { chemmacros / orbital / p } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_p_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_p_phase_bool } , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_p_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_p_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_p_scale_tl , angle .fp_set:N = \l_chemmacros_orbital_angle_fp , color .tl_set:N = \l_chemmacros_orbital_p_color_tl , @@ -2595,8 +2744,10 @@ \keys_define:nn { chemmacros / orbital / sp } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_sp_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_sp_phase_bool } , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_sp_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_sp_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_sp_scale_tl , angle .fp_set:N = \l_chemmacros_orbital_angle_fp , color .tl_set:N = \l_chemmacros_orbital_sp_color_tl @@ -2684,8 +2835,10 @@ \keys_define:nn { chemmacros / orbital / sp2 } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_sptwo_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_sptwo_phase_bool } , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_sptwo_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_sptwo_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_sptwo_scale_tl , angle .fp_set:N = \l_chemmacros_orbital_angle_fp , color .tl_set:N = \l_chemmacros_orbital_sptwo_color_tl @@ -2773,8 +2926,10 @@ \keys_define:nn { chemmacros / orbital / sp3 } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_spthree_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_spthree_phase_bool } , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_spthree_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_spthree_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_spthree_scale_tl , angle .fp_set:N = \l_chemmacros_orbital_angle_fp , color .tl_set:N = \l_chemmacros_orbital_spthree_color_tl @@ -3046,10 +3201,11 @@ Version history - new commands \p, \fplus, \fminus, \fpch, \fmch, \fscrp, \fsrcm, \fdelp, \fdelm, \orbital, \chemsetup - various commands have a new syntax - - removed: \setmhName, \setredoxdist, \setstatesubscript, - \porb, \phorb, \pxorb, \pyorb, \pzorb, \setorbheight, - \solid, \liquid - - reaction environments work with hyperref and varioref + - removed: \setmhName, \setredoxdist, + \setstatesubscript, \porb, \phorb, \pxorb, \pyorb, + \pzorb, \setorbheight, \solid, \liquid + - reaction environments work with hyperref and + varioref 2011/11/03 - version 2.0a - minor bug fixes - new feature for \Nu - new command \ba @@ -3070,7 +3226,8 @@ Version history - renamed formula => chemformula and ghs => ghsystem to make the names unique (following a request by Karl Berry for TeXlive) -2012/02/03 - version 3.0b - new command \DeclareChemParticle, updated documentation +2012/02/03 - version 3.0b - new command \DeclareChemParticle, updated + documentation 2012/02/05 - version 3.0c - renamed pictogram files (following a request by Karl Berry for TeXlive) - new package option "Nu" @@ -3078,9 +3235,22 @@ Version history - bugfixes with \DeclareChemParticle - new command \RenewChemParticle - new option phases / pos - - new commands \DeclareChemPhase, \RenewChemPhase, \phase + - new commands \DeclareChemPhase, \RenewChemPhase, + \phase - changed default behaviour of phases - removed optional argument from \sld and \lqd +2012/02/19 - version 3.1 - new commands \DeclareChemIUPAC and \RenewChemIUPAC + - new option iupac + - deprecated option: EZ + - deprecated commands: + \newreaction => \DeclareChemReaction + \setnewstate => \DeclareChemState + \renewstate => \RenewChemState + \Rcip => \R + \Scip => \S + \Dfi => \D + \Lfi => \L + - new arrow types in the chemformula package % --------------------------------------------------------------------------- % % TODO: diff --git a/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty b/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty index 8ca91155606..0e729748933 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/02/10 - % +% - 2012/02/19 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -28,7 +28,11 @@ % - The Current Maintainer of this work is Clemens Niederberger. - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \RequirePackage{ expl3 } -\ProvidesExplPackage {ghsystem} {2012/02/10} {3.0d} {globally harmonised system} +\ProvidesExplPackage + {ghsystem} + {2012/02/19} + {3.1} + {globally harmonised system} % --------------------------------------------------------------------------- % % error and warning messages: @@ -47,8 +51,8 @@ } { You've~tried~to~call~statement~#1#2~ \msg_line_context: \c_space_tl but~it~ - it~is~not~defined~in~ghsystem.sty . ~ Are~you~sure~it~exists? ~ If~so~please~send - ~a~message~to~the~author.~Thanks. + it~is~not~defined~in~ghsystem.sty . ~ Are~you~sure~it~exists? ~ If~so~please + ~send~a~message~to~the~author.~Thanks. } \msg_set:nnnn { ghsystem } { booktabs } @@ -152,7 +156,8 @@ \bool_set_true:c { l_ghsystem_#1_bool } \input { language / ghsystem_#1.def } \ExplSyntaxOn , % \ghs options: - hide .bool_set:N = \l_ghsystem_hide_statement_bool , + hide .bool_set:N = + \l_ghsystem_hide_statement_bool , hide .default:n = true , fill-in .bool_set:N = \l_ghsystem_fill_in_bool , fill-in .default:n = true , @@ -168,8 +173,10 @@ \cs_set:Npn \ghsystem_substance: { ~ #1 } , text .code:n = \cs_set:Npn \ghsystem_text: { ~ #1 } , - space .tl_set:N = \l_ghsystem_number_space_tl , - C-temperature .tl_set:N = \l_ghsystem_celsius_temperature_tl , + space .tl_set:N = + \l_ghsystem_number_space_tl , + C-temperature .tl_set:N = + \l_ghsystem_celsius_temperature_tl , F-temperature .tl_set:N = \l_ghsystem_fahrenheit_temperature_tl , kg-mass .tl_set:N = \l_ghsystem_kg_mass_tl , @@ -185,8 +192,10 @@ % \ghslistall options: table-head-number .tl_set:N = \l_ghsystem_identifier_tl , table-head-text .tl_set:N = \l_ghsystem_table_text_tl , - table-next-page .tl_set:N = \l_ghsystem_table_next_page_tl , - table-row-sep .dim_set:N = \l_ghsystem_table_line_sep_dim , + table-next-page .tl_set:N = + \l_ghsystem_table_next_page_tl , + table-row-sep .dim_set:N = + \l_ghsystem_table_line_sep_dim , table-head-rule .choice: , table-head-rule / default .code:n = \tl_set:Nn \l_ghsystem_table_head_rule_tl { \hline } , @@ -237,7 +246,8 @@ \tl_clear:N \l_ghsystem_table_foot_rule_tl \tl_clear:N \l_ghsystem_table_last_foot_rule_tl , table-caption .tl_set:N = \l_ghsystem_table_caption_tl , - table-caption-short .tl_set:N = \l_ghsystem_table_caption_short_tl , + table-caption-short .tl_set:N = + \l_ghsystem_table_caption_short_tl , table-label .tl_set:N = \l_ghsystem_table_label_tl } @@ -349,11 +359,13 @@ \exp_args:No \label { \l_ghsystem_table_label_tl } } \\ \l_ghsystem_table_top_head_rule_tl - \textbf { \l_ghsystem_identifier_tl } & \textbf { \l_ghsystem_table_text_tl } \\ + \textbf { \l_ghsystem_identifier_tl } & + \textbf { \l_ghsystem_table_text_tl } \\ \l_ghsystem_table_head_rule_tl \endfirsthead \l_ghsystem_table_top_head_rule_tl - \textbf { \l_ghsystem_identifier_tl } & \textbf { \l_ghsystem_table_text_tl } \\ + \textbf { \l_ghsystem_identifier_tl } & + \textbf { \l_ghsystem_table_text_tl } \\ \l_ghsystem_table_head_rule_tl \endhead \l_ghsystem_table_last_foot_rule_tl @@ -416,7 +428,10 @@ \group_begin: \IfNoValueF { #1 } { \keys_set:nn { chemmacros / ghsystem } { #1 } } \ghsystem_includegraphics:xn - { scale=\fp_to_tl:N \l_ghsystem_picture_scale_fp \l_ghsystem_picture_includegraphics_tl } + { + scale = \fp_to_tl:N \l_ghsystem_picture_scale_fp + \l_ghsystem_picture_includegraphics_tl + } { pictures / ghsystem_ #2 . \l_ghsystem_picture_type_tl } \group_end: } @@ -432,8 +447,12 @@ VERSION HISTORY 2012/01/30 - version 3.0a - bugfix in chemormula.sty, renamed ghs => ghsystem 2012/02/03 - version 3.0b - updated documentation 2012/02/05 - version 3.0c - renamed pictogram files -2012/02/1ß - version 3.0d - several bugfixes in chemformula, some new commands +2012/02/10 - version 3.0d - several bugfixes in chemformula, some new commands and options in chemmacros +2012/02/19 - version 3.1 - new functions in the chemmacros package + - new arrow types and functions in the chemformula + package + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO: diff --git a/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def b/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def index 1b63cd3ca98..58d8f861c98 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def +++ b/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def @@ -248,7 +248,7 @@ \prop_put:Nnn \l_ghsystem_p_prop { 321 } { Spe~ci\-fic~treat\-ment~(see ~ \l_ghsystem_dots_tl\ on~this~la\-bel). } \prop_put:Nnn \l_ghsystem_p_prop { 322 } { Spe~ci\-fic~mea\-sures~(see ~ \l_ghsystem_dots_tl\ on~this~la\-bel). } \prop_put:Nnn \l_ghsystem_p_prop { 330 } { Rinse~mouth. } -\prop_put:Nnn \l_ghsystem_p_prop { 331 } { Do~NOT~in\-duse~vo\-mitting. } +\prop_put:Nnn \l_ghsystem_p_prop { 331 } { Do~NOT~in\-duce~vo\-mitting. } \prop_put:Nnn \l_ghsystem_p_prop { 332 } { If~skin~irri\-tation~occurs : \ghsystem_text: } \prop_put:Nnn \l_ghsystem_p_prop { 333 } { If~skin~irri\-tation~or~rash~occurs : \ghsystem_text: } \prop_put:Nnn \l_ghsystem_p_prop { 334 } { Immerse~in~cool~wa\-ter/wrap~in~wet~ban\-da\-ges. } |