summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-10-28 22:44:38 +0000
committerKarl Berry <karl@freefriends.org>2013-10-28 22:44:38 +0000
commit2d51c9ecf81c2731d82fb9c7973c5c143e8960af (patch)
treec0a61de895f3c09b2d3f78ae23de07153c178c8c
parent1cede05dc55dbfc5b1087d336d45984b2e595ac3 (diff)
chemmacros (28oct13)
git-svn-id: svn://tug.org/texlive/trunk@32026 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/README6
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemformula_en.pdfbin294026 -> 935617 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemformula_en.tex2177
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemformula_test_sub_and_superscripts.tex36
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.pdfbin96884 -> 528829 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.tex524
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdfbin344609 -> 890090 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex3687
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.pdfbin365289 -> 787909 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.tex819
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemformula.sty357
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty230
12 files changed, 4130 insertions, 3706 deletions
diff --git a/Master/texmf-dist/doc/latex/chemmacros/README b/Master/texmf-dist/doc/latex/chemmacros/README
index ccd9d3eb0c7..b7634e6ea91 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/README
+++ b/Master/texmf-dist/doc/latex/chemmacros/README
@@ -1,12 +1,12 @@
--------------------------------------------------------------------------
the CHEMMACROS bundle
--> chemmacros package v4.1 -> macros and commands for chemists
--> chemformula package v4.1 -> typeset chemical compounds and reactions
+-> chemmacros package v4.2 -> macros and commands for chemists
+-> chemformula package v4.2 -> typeset chemical compounds and reactions
-> ghsystem package v4.0 -> typeset H & P statements and pictograms
from the globally harmonised system (GHS)
-> chemgreek package v0.2 -> handle mapping of upright greek letters to
the \chemalpha ... commands
-2013/08/24
+2013/10/28
--------------------------------------------------------------------------
This bundle succeeds the chemmacros package which is now part of the
bundle
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemformula_en.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemformula_en.pdf
index 2dc25020cab..59af1643ae4 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemformula_en.pdf
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemformula_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemformula_en.tex b/Master/texmf-dist/doc/latex/chemmacros/chemformula_en.tex
index 2d7864629a1..81fc8b7229c 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemformula_en.tex
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemformula_en.tex
@@ -1,56 +1,133 @@
-% arara: xelatex
+% arara: pdflatex
% !arara: biber
-% !arara: xelatex
-% !arara: xelatex
-\documentclass[DIV11,toc=index,toc=bib]{cnpkgdoc}
-\docsetup{
- pkg = {[greek=newtx]chemmacros},
- language = en,
- title = the \Chemmacros\ bundle,
- subtitle = {
- packages \Chemmacros\ (v\csname chemmacros@version\endcsname),
- \Chemformula\ (v\csname chemformula@version\endcsname),
- \Ghsystem\ (v\csname ghsystem@version\endcsname) and
- \Chemgreek\ (v\csname chemgreek@version\endcsname)\\[2ex]
- {\Large documentation for the \Chemformula\ package}},
- modules = true,
- code-box = {skipabove=1ex,skipbelow=1ex},
- label = {},
- name = chemformula,
- url = https://bitbucket.org/cgnieder/chemmacros/
+% !arara: pdflatex
+% arara: pdflatex
+% --------------------------------------------------------------------------
+% the CHEMMACROS bundle
+% chemformula_en.tex
+% macros and commands for chemists
+% --------------------------------------------------------------------------
+% Clemens Niederberger
+% --------------------------------------------------------------------------
+% https://bitbucket.org/cgnieder/chemmacros/
+% contact@mychemistry.eu
+% --------------------------------------------------------------------------
+% If you have any ideas, questions, suggestions or bugs to report, please
+% feel free to contact me.
+% --------------------------------------------------------------------------
+% Copyright 2011-2013 Clemens Niederberger
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Clemens Niederberger.
+% --------------------------------------------------------------------------
+\documentclass[load-preamble+]{cnltx-doc}
+\usepackage[greek=newtx]{chemmacros}
+\setcnltx{
+ package = {chemformula},
+ title = \huge the \chemmacros\ bundle,
+ url = https://bitbucket.org/cgnieder/chemmacros/ ,
+ authors = Clemens Niederberger ,
+ email = contact@mychemistry.eu ,
+ info = {
+ packages \chemmacros\ (v\csname chemmacros@version\endcsname),
+ \chemformula\ (v\csname chemformula@version\endcsname),
+ \ghsystem\ (v\csname ghsystem@version\endcsname) and
+ \chemgreek\ (v\csname chemgreek@version\endcsname)\\[2ex]
+ {\Large documentation for the \chemformula\ package}} ,
+ abstract = {%
+ \centering
+ \includegraphics{chemmacros-logo.pdf}
+ \par
+ } ,
+ add-cmds = {
+ abinitio, AddRxnDesc, anti, aq, aqi,
+ ba, bond, bridge,
+ cd, ch, charrow, chcpd, chemabove, Chemalpha, Chembeta, Chemgamma,
+ Chemdelta, ChemDelta, chemformula@bondlength, Chemomega, chemsetup,
+ chlewis, chname , cip, cis, ch, CNMR,
+ data, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias,
+ DeclareChemIUPAC, DeclareChemLatin, DeclareChemNMR, DeclareChemParticle,
+ DeclareChemPhase, DeclareChemReaction, DeclareChemState,
+ delm, delp, Delta, Dfi,
+ el, ElPot, endo, Enthalpy, enthalpy, Entropy,
+ fmch, fpch, fscrm, fscrp,
+ gas, ghs, ghslistall, ghspic, Gibbs, gram,
+ hapto, HNMR, Helmholtz,
+ insitu, invacuo, iupac,
+ Ka, Kb, Kw,
+ Lfi, listofreactions, lqd, ltn,
+ mch, mega, meta, mhName,
+ newman, NMR, Nu, Nuc,
+ orbital, ortho, ox, OX,
+ para, pch, per, pH, phase, photon, pKa, pKb, pOH, pos, positron,
+ Pot, prt,
+ Rad, redox, RenewChemArrow, RenewChemBond, RenewChemIUPAC,
+ RenewChemLatin, RenewChemNMR, RenewChemParticle, RenewChemPhase,
+ RenewChemState,
+ Sf, scrm, scrp, second, setchemformula, ShowChemArrow, ShowChemBond,
+ sld, Sod, State,
+ trans,
+ val
+ } ,
+ add-silent-cmds = {
+ addplot,
+ bottomrule,
+ cancel, cdot, ce, cee, celsius, centering, chemfig, chemname, clap,
+ cnsetup, color, cstack, cstsetup,
+ DeclareInstance, DeclareSIUnit, definecolor, draw,
+ electronvolt,
+ footnotesize,
+ glqq, grqq,
+ hertz, hspace,
+ includegraphics, intertext, IUPAC,
+ joule,
+ kilo,
+ latin, lewis, Lewis,
+ metre, midrule, milli, mmHg, mole,
+ nano, nicefrac, num, numrange,
+ ominus, oplus,
+ percent, pgfarrowsdeclarealias, pgfarrowsrenewalias,
+ renewtagform, rightarrow,
+ sample, scriptscriptstyle, setatomsep, setbondoffset, sfrac, shorthandoff,
+ si, SI, sisetup, square, subsection,
+ textcolor, textendash, textsuperscript, tiny, toprule,
+ upbeta, upeta, upgamma, usetikzlibrary,
+ volt, vphantom, vspave,
+ xspace
+ }
}
-\usepackage{chemfig,booktabs,cancel}
+\usepackage{chemfig,booktabs,cancel,varioref}
\usepackage[version=3]{mhchem}
-\usepackage{fontspec}
-\usepackage[oldstyle,proportional]{libertine}
+% \usepackage{fontspec}
+% \usepackage[oldstyle,proportional]{libertine}
\expandafter\def\csname libertine@figurestyle\endcsname{LF}
\usepackage[libertine]{newtxmath}
\expandafter\def\csname libertine@figurestyle\endcsname{OsF}
-\usepackage{libertinehologopatch}
-\setmonofont[Scale=MatchLowercase]{Bitstream Vera Sans Mono}
+% \usepackage{libertinehologopatch}
+% \setmonofont[Scale=MatchLowercase]{Bitstream Vera Sans Mono}
% \usepackage{selnolig}
-\cnpkgusecolorscheme{friendly}
-\renewcommand*\othersectionlevelsformat[3]{%
- \textcolor{main}{#3\autodot}\enskip}
-\renewcommand*\partformat{%
- \textcolor{main}{\partname~\thepart\autodot}}
-
-\usepackage{fnpct}
\usepackage[biblatex]{embrac}
\ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
-\pagestyle{headings}
-
\usepackage[accsupp]{acro}
\acsetup{
- long-format=\scshape,
- short-format=\scshape
+ long-format = \scshape ,
+ short-format = \scshape
}
\DeclareAcronym{ghs}{
short = ghs ,
@@ -92,71 +169,59 @@
\chemsetup{
option/synchronize ,
- chemformula/font-spec={[Numbers=Lining]Linux Libertine O}
+ chemformula/format = \libertineLF
}
-\colorlet{chemformula}{darkgray}
+% \colorlet{chemformula}{black!90}
\sisetup{
detect-mode=false,
mode=text,
- text-rm=\addfontfeatures{Numbers={Proportional,Lining}}
+ text-rm=\libertineLF
}
\usepackage{filecontents}
-\begin{filecontents*}{\jobname.ist}
- preamble "\\begin{theindex}\n Section titles are indicated \\textbf{bold},
- packages \\textsf{sans serif}, commands \\code{\\textbackslash\\textcolor{code}{brown}},
- options \\textcolor{key}{\\code{yellow}} and modules (only \\chemmacros)
- \\textcolor{module}{\\code{blue}}.\\newline\n\n"
- heading_prefix "{\\bfseries "
- heading_suffix "\\hfil}\\nopagebreak\n"
- headings_flag 1
- delim_0 "\\dotfill\\hyperpage{"
- delim_1 "\\dotfill\\hyperpage{"
- delim_2 "\\dotfill\\hyperpage{"
- delim_r "}\\textendash\\hyperpage{"
- delim_t "}"
- suffix_2p "\\nohyperpage{\\,f.}"
- suffix_3p "\\nohyperpage{\\,ff.}"
-\end{filecontents*}
-
-\usepackage[backend=biber,style=alphabetic,maxbibnames=20]{biblatex}
\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ürgen Stohner and Herbert L. Strauss and
- Michio Takami and Anders J Thor},
- title = {“Quantities, Symbols and Units in Physical Chemistry”, \acs{iupac}
- Green Book},
- edition = {3rd Edition. 2nd Printing},
- year = {2008},
+ Bertil Holmstr\"om and Kozo Kuchitsu and Roberto Marquardt and Ian Mills and
+ Franco Pavese and Martin Quack and J\"urgen Stohner and Herbert L. Strauss and
+ Michio Takami and Anders J Thor} ,
+ title = {``Quantities, Symbols and Units in Physical Chemistry'', \acs{iupac}
+ Green Book} ,
+ sorttitle = {Quantities, Symbols and Units in Physical Chemistry} ,
+ indexsorttitle = {Quantities, Symbols and Units in Physical Chemistry} ,
+ edition = {3rd Edition. 2nd Printing} ,
+ year = {2008} ,
publisher = {\acs{iupac} \&\ RSC Publishing, Cambridge}
}
@book{iupac:redbook,
author = {Neil G. Connelly and Ture Damhus and Richard M. Hartshorn and
- Alan T. Hutton},
- title = {“Nomenclature of Inorganic Chemistry”, \acs{iupac} Red Book},
- year = {2005},
- publisher = { \acs{iupac} \&\ RSC Publishing, Cambridge},
+ Alan T. Hutton} ,
+ title = {``Nomenclature of Inorganic Chemistry'', \acs{iupac} Red Book} ,
+ sorttitle = {Nomenclature of Inorganic Chemistry} ,
+ indexsorttitle = {Nomenclature of Inorganic Chemistry} ,
+ year = {2005} ,
+ publisher = { \acs{iupac} \&\ RSC Publishing, Cambridge} ,
isbn = {0-85404-438-8}
}
@misc{eu:ghsystem_regulation,
author = {{The European Parliament and The Council of the European Union}},
- title = {Regulation (EC) No 1272/2008 of the European Parliament and of the Council},
- subtitle = {on classification, labelling and packaging of substances and mixtures,
- amending and repealing Directives 67/548/EEC and 1999/45/EC, and amending
- Regulation (EC) No 1907/2006},
- journal = {Official Journal of the European Union},
+ title = {Regulation (EC) No 1272/2008 of the European Parliament and of
+ the Council} ,
+ subtitle = {on classification, labelling and packaging of substances and
+ mixtures, amending and repealing Directives 67/548/EEC and 1999/45/EC, and
+ amending Regulation (EC) No 1907/2006} ,
+ journal = {Official Journal of the European Union} ,
date = {2008-12-16}
}
@online{unece:ghsystem_implementation,
- author = {United Nations Economic Commission for Europe},
- title = {GHS Implementation},
- url = {http://www.unece.org/trans/danger/publi/ghs/implementation_e.html},
- urldate = {2012-03-20},
+ author = {United Nations Economic Commission for Europe} ,
+ title = {GHS Implementation} ,
+ url =
+ {http://www.unece.org/trans/danger/publi/ghs/implementation_e.html} ,
+ urldate = {2012-03-20} ,
date = {2012-03-20}
}
\end{filecontents*}
@@ -174,276 +239,192 @@
\usetikzlibrary{calc,positioning,decorations.pathmorphing,patterns}
-\pgfdeclaredecoration{penciline}{initial}{
- \state{initial}[
- width=+\pgfdecoratedinputsegmentremainingdistance,
- auto corner on length=1mm
- ]{
- \pgfpathcurveto%
- {% From
- \pgfqpoint
- {\pgfdecoratedinputsegmentremainingdistance}
- {\pgfdecorationsegmentamplitude}
- }
- {% Control 1
- \pgfmathrand
- \pgfpointadd
- {\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- {%
- \pgfqpoint
- {-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}%
- {\pgfmathresult\pgfdecorationsegmentamplitude}
- }
- }
- {%TO
- \pgfpointadd
- {\pgfpointdecoratedinputsegmentlast}
- {\pgfpoint{1pt}{1pt}}
- }
- }
- \state{final}{}
-}
-\tikzset{pencil/.style={decorate,decoration=penciline}}
-
-\TitlePicture{%
- \ch[font-spec={Augie}]{
- 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
- ->
- 2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
- }
- \redox(o1,o2)[red,pencil,-cf]{\small\ch[font-spec={[Color=red]Augie},math-space=.3em]{$-$ 2 e-}}
- \redox(r1,r2)[blue,pencil,-cf][-1]{\small\ch[font-spec={[Color=blue]Augie},math-space=.3em]{$+$ 2 e-}}}
-
-\addcmds{
- a, abinitio, addplot, AddRxnDesc, anti, aq, aqi,
- b, ba, bond, bottomrule, bridge,
- cancel, cd, cdot, ce, cee, celsius, centering, chemabove, Chemalpha,
- Chembeta, Chemgamma, Chemdelta, ChemDelta, chemfig, chemname, Chemomega,
- chemsetup, cip, cis, ch, clap, cnsetup, CNMR, color, cstack, cstsetup,
- d, D, data, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias,
- DeclareChemIUPAC, DeclareChemLatin, DeclareChemNMR, DeclareChemParticle,
- DeclareChemPhase, DeclareChemReaction, DeclareChemState, DeclareInstance,
- DeclareSIUnit, definecolor, delm, delp, Delta, Dfi, draw,
- E, el, electronvolt, ElPot, endo, Enthalpy, enthalpy, Entropy,
- footnotesize, fmch, fpch, fscrm, fscrp,
- g, gas, ghs, ghslistall, ghspic, Gibbs, glqq, gram, grqq,
- H, hapto, HNMR, Helmholtz, hertz, hspace,
- includegraphics, insitu, intertext, invacuo, iupac, IUPAC,
- J, joule,
- Ka, Kb, kilo, Kw,
- L, latin, lewis, Lewis, Lfi, listofreactions, lqd, ltn,
- mch, mega, meta, metre, mhName, midrule, milli, mmHg, mole,
- N, nano, nicefrac, newman, NMR, Nu, Nuc, num, numrange,
- O, ominus, orbital, ortho, oplus, ox, OX,
- p, P, para, pch, per, percent, pgfarrowsdeclarealias, pgfarrowsrenewalias,
- pH, phase, photon, pKa, pKb, pOH, pos, positron, Pot, prt,
- R, Rad, redox, RenewChemArrow, RenewChemBond, RenewChemIUPAC,
- RenewChemLatin, RenewChemNMR, RenewChemParticle, RenewChemPhase,
- RenewChemState, renewtagform, rightarrow,
- S, Sf, sample, scriptscriptstyle, scrm, scrp, second, setatomsep,
- setbondoffset, setchemformula, sfrac, shorthandoff, ShowChemArrow,
- ShowChemBond, si, SI, sisetup, sld, Sod, square, State, subsection,
- textcolor, textendash, textsuperscript, tiny, toprule, trans,
- upbeta, upeta, upgamma,
- val, volt, vphantom, vspave,
- w, xspace, Z
-}
-
-\usepackage{imakeidx}
-\indexsetup{othercode=\footnotesize}
-\makeindex[columns=3,intoc,options={-sl \jobname.ist}]
-
-\newcommand*\Chemmacros{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemmacros%
- }%
-}
-\providecommand*\chemmacros{{\scshape\textcolor{main}{chemmacros}}\xspace}
+\newpackagename\chemmacros{chemmacros}
+% \newpackagename\chemformula{chemformula}
+\newpackagename\ghsystem{ghsystem}
+\newpackagename\chemgreek{chemgreek}
-\newcommand*\Chemformula{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemformula%
- }%
-}
-\providecommand*\chemformula{{\scshape\textcolor{main}{chemformula}}\xspace}
-\newcommand*\Ghsystem{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- ghsystem%
- }%
-}
-\providecommand*\ghsystem{{\scshape\textcolor{main}{ghsystem}}\xspace}
+\newidxcmd\manual{\textsf{#1}}[\ (manual)]
-\newcommand*\Chemgreek{%
+\newenvironment{codedesc}
{%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemgreek%
- }%
-}
-\providecommand*\chemgreek{{\scshape\textcolor{main}{chemgreek}}\xspace}
+ \def\Code##1{\item\code{##1}\hfill\newline}%
+ \cnltxlist
+ }
+ {\endcnltxlist}
\renewcommand*\AmS{\hologo{AmS}}
+\newcommand*\TikZ{Ti\textit{k}Z}
+\newname\hensel{Martin}{Hensel}
\begin{document}
\section{Introduction}
-Probably every chemist using \LaTeXe\ is aware of the great \paket{mhchem}
-package by Martin Hensel. There have always been some difficulties
-intertwining it with \chemmacros, though. Also, some other minor points in
-\paket{mhchem} always bothered me, but they hardly seemed enough for a new
-package. They weren't even enough for a feature request to the \paket{mhchem}
-author. The challenge and the fun of creating a new package and the wish for
-a highly customizable alternative led to \chemformula\ after all.
-
-\chemformula\ works very similar to \paket{mhchem} but is more strict as to how
+Probably every chemist using \LaTeXe\ is aware of the great \pkg{mhchem}
+package by \hensel. There have always been some difficulties intertwining it
+with \chemmacros, though. Also, some other minor points in \pkg{mhchem}
+always bothered me, but they hardly seemed enough for a new package. They
+weren't even enough for a feature request to the \pkg{mhchem} author. The
+challenge and the fun of creating a new package and the wish for a highly
+customizable alternative led to \chemformula\ after all.
+
+\chemformula\ works very similar to \pkg{mhchem} but is more strict as to how
compounds, stoichiometric factors and arrows are input. In the same time
\chemformula\ offers \emph{many} possibilities to customize the output.
-\sinceversion{4.0}Since version 4.0, the \chemformula\ package can be used
+\section{News}
+\subsection{Version 4.0}
+Since version 4.0\sinceversion{4.0}, the \chemformula\ package can be used
independently from \chemmacros. This means that if you say
-\begin{beispiel}[code only]
+\begin{sourcecode}
\usepackage{chemformula}
-\end{beispiel}
+\end{sourcecode}
then \chemmacros\ will not be loaded. The \chemmacros\ package, however,
\emph{will} load \chemformula.
+\subsection{Version 4.2}
+\begin{itemize}
+ \item New option \option{arrow-style}.
+ \item New command \cs{chlewis} that allows to add Lewis electrons to an
+ atom, see section~\ref{sec:lewis-formulae}.
+\end{itemize}
+
\section{Licence and Requirements}
-Permission is granted to copy, distribute and/or modify this software under
-the terms of the \LaTeX\ project public license (lppl) version 1.3 or later
-(\url{http://www.latex-project.org/lppl.txt}). The package has the status
-``maintained.''
-
-The \chemformula\ package needs and thus loads the packages \paket*{expl3}
-(from the \paket*{l3kernel}\footnote{\CTANurl{l3kernel}}), \paket*{xparse},
-\paket*{l3keys2e} and \paket*{xfrac} (from the
-\paket*{l3packages}\footnote{\CTANurl{l3packages}}),
-\paket*{tikz}\footnote{\CTANurl[graphics]{pgf}}, \paket{amsmath},
-\paket*{nicefrac} and \paket*{scrlfile} (from the
-\KOMAScript\footnote{\CTANurl{koma-script}} bundle).
+\license
+
+The \chemformula\ package needs and thus loads the packages
+\bnd{l3kernel}~\cite{bnd:l3kernel}, \pkg{xparse}, \pkg{l3keys2e} and
+\pkg{xfrac} (all three are part of the \bnd{l3packages}
+bundle~\cite{bnd:l3packages}),
+\pkg{tikz}\footnote{\CTANurl[graphics]{pgf}}~\cite{pkg:pgf},
+\pkg{amsmath}~\cite{pkg:amsmath}, \pkg{nicefrac}~\cite{pkg:nicefrac} and
+\pkg{scrlfile} (from the \KOMAScript\footnote{\CTANurl{koma-script}}
+bundle~\cite{bnd:koma-script}).
\section{Setup}
All of \chemformula's options belong to \chemmacros' module
-\textcolor{module}{\code{chemformula}}. This means they can be setup with
-\begin{beispiel}[code only]
- \chemsetup[chemformula]{<options>} or
- \chemsetup{chemformula/<option1>,chemformula/<option2>}
-\end{beispiel}
+\module{chemformula}. This means they can be setup with
+\begin{commands}
+ \command{chemsetup}[\Oarg{chemformula}\marg{options}]
+ Set up options for \chemformula\ exclusively, or
+ \command{chemsetup}[\Marg{chemformula/\meta{option1},chemformula/\meta{option2}}]
+ Set up options for \chemformula\ together with others of \chemmacros'
+ options.
+\end{commands}
However, if you're using \chemformula\ as a standalone package the command
-\cmd{chemsetup} is not available. This is why \chemformula\ also has its own
+\cs{chemsetup} is not available. This is why \chemformula\ also has its own
setup command:
-\begin{beispiel}[code only]
- \setchemformula{<options>}
-\end{beispiel}
+\begin{commands}
+ \command{setchemformula}[\marg{options}]
+ Set up \chemformula\ when using it independently from \chemmacros.
+\end{commands}
\section{The Basic Principle}
\chemformula\ offers one main command.
-\begin{beschreibung}
- \Befehl{ch}[<options>]{<input>}
-\end{beschreibung}
-The usage will seem very familiar to you if you're familiar with \paket{mhchem}:
-\begin{beispiel}
- \ch{H2O} \\
- \ch{Sb2O3} \\
- \ch{H+} \\
- \ch{CrO4^2-} \\
- \ch{AgCl2-} \\
- \ch{[AgCl2]-} \\
- \ch{Y^{99}+} \\
- \ch{Y^{99+}} \\
- \ch{H2_{(aq)}} \\
- \ch{NO3-} \\
- \ch{(NH4)2S} \\
- \ch{^{227}_{90}Th+} \\
- $V_{\ch{H2O}}$ \\
- \ch{Ce^{IV}} \\
- \ch{KCr(SO4)2 * 12 H2O}
-\end{beispiel}
+\begin{commands}
+ \command{ch}[\oarg{options}\marg{input}]
+ \chemformula's main command.
+\end{commands}
+The usage will seem very familiar to you if you're familiar with \pkg{mhchem}:
+\begin{example}[side-by-side]
+ \ch{H2O} \par
+ \ch{Sb2O3} \par
+ \ch{H+} \par
+ \ch{CrO4^2-} \par
+ \ch{AgCl2-} \par
+ \ch{[AgCl2]-} \par
+ \ch{Y^{99}+} \par
+ \ch{Y^{99+}} \par
+ \ch{H2_{(aq)}} \par
+ \ch{NO3-} \par
+ \ch{(NH4)2S} \par
+ \ch{^{227}_{90}Th+} \par
+ $V_{\ch{H2O}}$ \par
+ \ch{Ce^{IV}} \par
+ \ch{KCr(SO4)2 * 12 H2O}
+\end{example}
However, there are differences. The most notable one: \chemformula\
distinguishes between different types of input. These different parts
\emph{have} to be separated with blanks:
-\begin{beschreibung}
- \Befehl{ch}{part1 part2 part3 part4}
-\end{beschreibung}
+\begin{commands}
+ \command{ch}[\Marg{part1 part2 part3 part4}]
+\end{commands}
A blank in the input \emph{never} is a blank in the output. This role of the
blank strictly holds and disregarding it can have unexpected results and even
lead to errors.
Another notable difference: \chemformula\ tries to avoid math mode whenever
possible:
-\begin{beispiel}
- \ch{A + B ->[a] C} \\
- \ce{A + B ->[a] C}
-\end{beispiel}
-
-This means that \cmd{ch}{2H2O} is recognized as a \emph{single} part, which in
-this case is recognized as a compound.
-\begin{beispiel}
- \ch{2H2O} \\
- \ch{2 H2O}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{A + B ->[a] C} \par
+ \ce{A + B ->[a] C}
+\end{example}
+
+This means that \cs{ch}\Marg{2H2O} is recognized as a \emph{single} part,
+which in this case is recognized as a compound.
+\begin{example}[side-by-side]
+ \ch{2H2O} \par
+ \ch{2 H2O}
+\end{example}
This also means, that a part cannot contain a blank since this will
automatically divide it into two parts. If you need an extra blank in the
-output you need to use \lstinline+~+. However, since commands in most cases
-gobble a space after them a input like \cmd{ch}{\textbackslash command ABC}
-will be treated as a single part. If you want or need to divide them you need
-to add an empty group: \cmd{ch}{\textbackslash command\{\} ABC}. The
-different input types are described in the following sections.
+output you need to use \verbcode+~+. However, since commands in most cases
+gobble a space after them a input like \cs{ch}\Marg{\cs*{command} ABC} will be
+treated as a single part. If you want or need to divide them you need to add
+an empty group: \cs{ch}\Marg{\cs*{command}\marg{} ABC}. The different input
+types are described in the following sections.
% TODO: Module überdenken, Beschreibung anpassen
-There are some options to customize the output of the \cmd{ch} command. They
+There are some options to customize the output of the \cs{ch} command. They
can either be applied locally using the optional argument or can be set
globally using the setup command. All options of \chemformula\ belong to the
-module \textcolor{module}{\code{chemformula}} and can be set in different
-ways:
-\begin{beschreibung}
- \Befehl{chemsetup}[chemformula]{<options>} (when loaded via \chemmacros)
- \Befehl{chemsetup}{chemformula/<options>} (when loaded via \chemmacros)
- \Befehl{setchemformula}{<options>} (independent from \chemmacros)
-\end{beschreibung}
-
-\section{Stoichiometric Factors}\secidx{Stoichiometric Factors}
+module \module{chemformula} and can be set in different ways:
+\begin{commands}
+ \command{chemsetup}[\Oarg{chemformula}\marg{options}]
+ when loaded via \chemmacros
+ \command{chemsetup}[\Marg{chemformula/\meta{options}}]
+ when loaded via \chemmacros
+ \command{setchemformula}[\marg{options}]
+ independent from \chemmacros
+\end{commands}
+
+\section{Stoichiometric Factors}
A stoichiometric factor may only contain of numbers and the signs
-\lstinline+.,_/()+
-\begin{beispiel}
- \ch{2} \\
- \ch{12}
-
- % decimals:
- \ch{.5} \\
- \ch{5,75}
-
- % fractions:
- \ch{3/2} \\
- \ch{1_1/2}
+\verbcode+.,_/()+
+\begin{example}[side-by-side]
+ \ch{2} \par
+ \ch{12}
+
+ % decimals:
+ \ch{.5} \par
+ \ch{5,75}
+
+ % fractions:
+ \ch{3/2} \par
+ \ch{1_1/2}
- % ``iupac'':
- \ch{(1/2)}
-\end{beispiel}
+ % ``iupac'':
+ \ch{(1/2)}
+\end{example}
As you can see if you input decimal numbers a missing leading zero is added.
You have to be a little bit careful with the right syntax but I believe it is
rather intuitive.
-\begin{beispiel}[code only]
- this won't work but will result in an error: \ch{1/1_1}
-\end{beispiel}
+\begin{sourcecode}
+ this won't work but will result in an error: \ch{1/1_1}
+\end{sourcecode}
If stoichiometric factors are enclosed with parentheses the fractions are not
recognized and missing leading zeros are not added. What's inside the
parentheses is typeset as is.
-\begin{beispiel}
- \ch{(1/2) H2O} \ch{1/2 H2O} \ch{0.5 H2O}
-\end{beispiel}
+\begin{example}
+ \ch{(1/2) H2O} \ch{1/2 H2O} \ch{0.5 H2O}
+\end{example}
You can find many examples like the following for stoichiometric factors in
parentheses in the \acs{iupac} Green Book~\cite{iupac:greenbook}:
\begin{reaction*}
@@ -451,568 +432,581 @@ parentheses in the \acs{iupac} Green Book~\cite{iupac:greenbook}:
\end{reaction*}
There are a few possibilities to customize the output.
-\begin{beschreibung}
- \Option{decimal-marker}{<marker>}\Default{.}
- The symbol to indicate the decimal.
- \Option{frac-style}{math|xfrac|nicefrac}\Default{math}
- Determines how fractions are displayed.
- \Option{frac-math-cmd}{<command sequence>}\Default{\cmd*{frac}}
- \sinceversion{4.1}Allows you to choose which command is used with
- \key{frac-style}{math}. This needs to be a command sequence that takes two
- arguments that are set in math mode.
- \Option{stoich-space}{<skip>}\Default{.1667em plus .0333em minus .0117em}
- The space that is placed after the stoichiometric factor. A rubber
- length.
- \Option{stoich-paren-parse}{\default{true}|false}\Default{false}
- If set to true stoichiometric factors enclosed by parentheses also are
- parsed.
-\end{beschreibung}
-\begin{beispiel}
- \ch[decimal-marker={,}]{3.5} \ch[decimal-marker={$\cdot$}]{3,5}
-\end{beispiel}
-
-The option \key{frac-style}{xfrac} uses the \lstinline+\sfrac+ command of the
-\paket{xfrac} package. The output strongly depends on the font you
-use.\secidx[xfrac]{Stoichiometric Factors}
-\begin{beispiel}
- \ch[frac-style=xfrac]{3/2} \ch[frac-style=xfrac]{1_1/2}
-\end{beispiel}
-\chemformula\ defines the instance \lstinline=formula-text-frac= which you can
-redefine to your needs. See the \paket{xfrac} documentation for further
+\begin{options}
+ \keyval{decimal-marker}{marker}\Default{.}
+ The symbol to indicate the decimal.
+ \keychoice{frac-style}{math,xfrac,nicefrac}\Default{math}
+ Determines how fractions are displayed.
+ \keyval{frac-math-cmd}{command sequence}\Default{\cs*{frac}}
+ \sinceversion{4.1}Allows you to choose which command is used with
+ \keyis{frac-style}{math}. This needs to be a command sequence that takes
+ two arguments that are set in math mode.
+ \keyval{stoich-space}{skip}\Default{.1667em plus .0333em minus .0117em}
+ The space that is placed after the stoichiometric factor. A rubber
+ length.
+ \keybool{stoich-paren-parse}\Default{false}
+ If set to true stoichiometric factors enclosed by parentheses also are
+ parsed.
+\end{options}
+
+\begin{example}
+ \ch[decimal-marker={,}]{3.5} \ch[decimal-marker={$\cdot$}]{3,5}
+\end{example}
+
+The option \keyis{frac-style}{xfrac} uses the \verbcode+\sfrac+ command of the
+\pkg{xfrac} package. The output strongly depends on the font you use.
+\begin{example}
+ \ch[frac-style=xfrac]{3/2} \ch[frac-style=xfrac]{1_1/2}
+\end{example}
+\chemformula\ defines the instance \verbcode=formula-text-frac= which you can
+redefine to your needs. See the \pkg{xfrac} documentation for further
information. The default definition is this:
-\begin{beispiel}[code only]
- \DeclareInstance{xfrac}{chemformula-text-frac}{text}
- {
- slash-left-kern = -.15em ,
- slash-right-kern = -.15em
- }
-\end{beispiel}
+\begin{sourcecode}
+ \DeclareInstance{xfrac}{chemformula-text-frac}{text}
+ {
+ slash-left-kern = -.15em ,
+ slash-right-kern = -.15em
+ }
+\end{sourcecode}
This document uses the font Linux Libertine~O and the following definition:
-\begin{beispiel}[code only]
- \DeclareInstance{xfrac}{chemformula-text-frac}{text}
- {
- scale-factor = 1 ,
- denominator-bot-sep = -.2ex ,
- denominator-format = \scriptsize #1 ,
- numerator-top-sep = -.2ex ,
- numerator-format = \scriptsize #1 ,
- slash-right-kern = .05em ,
- slash-left-kern = .05em
- }
-\end{beispiel}
-
-The option \key{frac-style}{nicefrac} uses the \lstinline+\nicefrac+ command
-of the \paket{nicefrac} package.\secidx[nicefrac]{Stoichiometric Factors}
-\begin{beispiel}
- \ch[frac-style=nicefrac]{3/2} \ch[frac-style=nicefrac]{1_1/2}
-\end{beispiel}
-
-The option \key{stoich-space} allows you to customize the space between
-stoichiometric factor and the group following after
-it.\secidx[space]{Stoichiometric Factors}
-\begin{beispiel}
- \ch{2 H2O} \\
- \ch[stoich-space=.3em]{2 H2O}
-\end{beispiel}
-\secidx*{Stoichiometric Factors}
-
-\section{Compounds}\label{ssec:compounds}\secidx{Compounds}
+\begin{sourcecode}
+ \DeclareInstance{xfrac}{chemformula-text-frac}{text}
+ {
+ scale-factor = 1 ,
+ denominator-bot-sep = -.2ex ,
+ denominator-format = \scriptsize #1 ,
+ numerator-top-sep = -.2ex ,
+ numerator-format = \scriptsize #1 ,
+ slash-right-kern = .05em ,
+ slash-left-kern = .05em
+ }
+\end{sourcecode}
+
+The option \keyis{frac-style}{nicefrac} uses the \verbcode+\nicefrac+ command
+of the \pkg{nicefrac} package.
+\begin{example}
+ \ch[frac-style=nicefrac]{3/2} \ch[frac-style=nicefrac]{1_1/2}
+\end{example}
+
+The option \option{stoich-space} allows you to customize the space between
+stoichiometric factor and the group following after it.
+\begin{example}[side-by-side]
+ \ch{2 H2O} \par
+ \ch[stoich-space=.3em]{2 H2O}
+\end{example}
+
+\section{Compounds}\label{ssec:compounds}
\chemformula\ determines compounds as the type that ``doesn't fit in anywhere
else.'' This point will become more clear when you know what the other types
are.
-\begin{beispiel}
- \ch{H2SO4} \\
- \ch{[Cu(NH3)4]^2+}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{H2SO4} \par
+ \ch{[Cu(NH3)4]^2+}
+\end{example}
-\subsection{Adducts}\secidx[adducts]{Compounds}
+\subsection{Adducts}
\chemformula\ has two identifiers which will create adducts.
-\begin{beschreibung}
- \Befehl{ch}{A.B}\newline \ch{A.B}
- \Befehl{ch}{A*B}\newline \ch{A*B}
-\end{beschreibung}
-\begin{beispiel}
- \ch{CaSO4.H2O} \\
- \ch{CaSO4*H2O}
-\end{beispiel}
+\begin{commands}
+ \command{ch}[\Marg{A.B}] \ch{A.B}
+ \command{ch}[\Marg{A*B}] \ch{A*B}
+\end{commands}
+\begin{example}[side-by-side]
+ \ch{CaSO4.H2O} \par
+ \ch{CaSO4*H2O}
+\end{example}
Since numbers in a compound always are treated as subscripts (see
section~\ref{ssec:subscripts}) you sometimes need to introduce stoichiometric
factors for the right output:
-\begin{beispiel}
- \ch{Na3PO4*12H2O} \\
- \ch{Na3PO4* 12 H2O} \\
- \ch{Na3PO4 * 12 H2O}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{Na3PO4*12H2O} \par
+ \ch{Na3PO4* 12 H2O} \par
+ \ch{Na3PO4 * 12 H2O}
+\end{example}
-\subsection{Subscripts}\label{ssec:subscripts}\secidx[subscripts]{Compounds}
+\subsection{Subscripts}\label{ssec:subscripts}
\emph{All} numbers in a compound are treated as subscripts.
-\begin{beispiel}
- \ch{H2SO4}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{H2SO4}
+\end{example}
If you want a letter to be a subscript you can use the math syntax:
-\begin{beispiel}
- \ch{A_nB_m}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{A_nB_m}
+\end{example}
The subscript recognizes groups. You can also use math inside it.
-\begin{beispiel}
- \ch{A_{$n$}B_{$m$}} \\
- \ch{NaCl_{(aq)}}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{A_{$n$}B_{$m$}} \par
+ \ch{NaCl_{(aq)}}
+\end{example}
-\subsection{Commands}\secidx[commands]{Compounds}
+\subsection{Commands}
Commands are allowed in a compound:
-\begin{beispiel}
- \ch{\textbf{A2}B3} \ch{A2\color{red}B3}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{\textbf{A2}B3} \ch{A2\color{red}B3}
+\end{example}
However, if the commands demand numbers as argument, \eg, space commands or
-\chemmacros' \lstinline+\ox+ command the direct use will fail. This is
+\chemmacros' \verbcode+\ox+ command the direct use will fail. This is
because the numbers are treated as subscripts \emph{before} the command
expands.
-\begin{beispiel}[code only]
+\begin{sourcecode}
\ch{A\hspace{2mm}B} will raise an error because \hspace sees something like
this: \hspace{$_2$mm}. Actually not at all like it but equally bad\ldots
-\end{beispiel}
+\end{sourcecode}
See section~\ref{ssec:text} for a way around this.
-\subsection{Charges and Other Superscripts}\secidx[charges]{Compounds}\secidx[superscripts]{Compounds}
+\subsection{Charges and Other Superscripts}
\paragraph{Basics}
If a compound \emph{ends} with a plus or minus sign it will be treated as
charge sign and typeset as superscript. In other places a plus is treated as
a triple bond and a dash will be used as a single bond, see
section~\ref{ssec:bonds}.
-\begin{beispiel}
- \ch{A+B} \ch{AB+} \\
- \ch{A-B} \ch{AB-}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{A+B} \ch{AB+} \par
+ \ch{A-B} \ch{AB-}
+\end{example}
For longer charge groups or other superscripts you can use the math syntax.
It recognizes groups and you can use math inside them. Inside these groups
neither \code{+} nor \code{-} are treated as bonds. If a dot \code{.} is
inside a superscript it is treated as indicator for a radical. A \code{*}
gives the excited state.
-\begin{beispiel}
- \ch{A^{x-}} \\
- \ch{A^x-} \\
- \ch{A^{x}-} \\
- \ch{A^{$x-$}} \\
- \ch{RNO2^{-.}} \\
- \ch{^31H} \\
- \ch{^{14}6C} \\
- \ch{^{58}_{26}Fe} \\
- \ch{NO^*}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{A^{x-}} \par
+ \ch{A^x-} \par
+ \ch{A^{x}-} \par
+ \ch{A^{$x-$}} \par
+ \ch{RNO2^{-.}} \par
+ \ch{^31H} \par
+ \ch{^{14}6C} \par
+ \ch{^{58}_{26}Fe} \par
+ \ch{NO^*}
+\end{example}
Ions and ion composites with more than one charge can be typeset quite as
easy:
-\begin{beispiel}
- \ch{SO4^2-} \ch{Ca^2+ SO4^2-}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{SO4^2-} \ch{Ca^2+ SO4^2-}
+\end{example}
-\paragraph{Charge Commands}\secidx[superscripts!charge commands]{Compounds}
-You don't need to use \cmd{mch} and related commands inside \cmd{ch}. Indeed,
+\paragraph{Charge Commands}
+You don't need to use \cs{mch} and related commands inside \cs{ch}. Indeed,
you \emph{shouldn't} use them as they might mess with the subscript and
superscript alignment. The \chemmacros\ option \code{circled} is obeyed by
-\cmd{ch}.
-\begin{beispiel}
- \chemsetup[option]{circled=all}
- \ch{H+ + OH- <=> H2O}
-\end{beispiel}
+\cs{ch}.
+\begin{example}
+ \chemsetup[option]{circled=all}
+ \ch{H+ + OH- <=> H2O}
+\end{example}
-\paragraph{Behaviour}\secidx[superscripts!behaviour]{Compounds}
+\paragraph{Behaviour}
The supercripts behave differently depending on their position in a compound,
if there are super- and subscripts following each other directly.
-\begin{beispiel}
- \ch{^33B} \ch{{}^33B} \ch{3^3B} \ch{B^3} \ch{B3^3} \\
- \ch{^{23}_{123}B} \ch{{}^{23}_{123}B} \ch{_{123}^{23}B} \ch{B^{23}} \ch{B_{123}^{23}} \\
- \ch{^{123}_{23}B} \ch{{}^{123}_{23}B} \ch{_{23}^{123}B} \ch{B^{123}} \ch{B23^{123}}
-\end{beispiel}
+\begin{example}
+ \ch{^33B} \ch{{}^33B} \ch{3^3B} \ch{B^3} \ch{B3^3} \par
+ \ch{^{23}_{123}B} \ch{{}^{23}_{123}B} \ch{_{123}^{23}B}
+ \ch{B^{23}} \ch{B_{123}^{23}} \par
+ \ch{^{123}_{23}B} \ch{{}^{123}_{23}B} \ch{_{23}^{123}B}
+ \ch{B^{123}} \ch{B23^{123}}
+\end{example}
\begin{itemize}
-\item If a compound \emph{starts} with a sub- or superscript both sub- and
- superscript are aligned to the \emph{right} else to the \emph{left}.
-\item If a compound \emph{does not start} with a sub- or superscript and there
- is both a sub- and a superscript, the superscript is shifted additionally by
- a length determined from the option \key{charge-hshift}{<dim>}, also see
- page~\pageref{desc:charge-hshift}f.
+ \item If a compound \emph{starts} with a sub- or superscript both sub- and
+ superscript are aligned to the \emph{right} else to the \emph{left}.
+ \item If a compound \emph{does not start} with a sub- or superscript and
+ there is both a sub- and a superscript, the superscript is shifted
+ additionally by a length determined from the option
+ \key{charge-hshift}{dim}, also see page~\pageref{desc:charge-hshift}f.
\end{itemize}
The second point follows \ac{iupac}'s recommendations:
-\begin{zitat}[{\acs{iupac} Green Book {\cite[][p.\,51]{iupac:greenbook}}}]
+\begin{cnltxquote}[{\acs{iupac} Green Book {\cite[][p.\,51]{iupac:greenbook}}}]
In writing the formula for a complex ion, spacing for charge number can be
added (staggered arrangement), as well as parentheses:
- \ch[charge-hshift=full]{SO4^2-}, \ch{(SO4)^2-} The staggered arrangement is
- now recommended.
-\end{zitat}
+ \ch[charge-hshift=full]{SO4^2-}, \ch{(SO4)^2-}. The staggered arrangement
+ is now recommended.
+\end{cnltxquote}
-\subsection{Bonds}\label{ssec:bonds}\secidx[bonds]{Compounds}
+\subsection{Bonds}\label{ssec:bonds}
\subsubsection{Native Bonds}
There are three kinds of what I will call ``native bonds'':
-\begin{beispiel}
- single: \ch{CH3-CH3} \\
- double: \ch{CH2=CH2} \\
- triple: \ch{CH+CH}
-\end{beispiel}
+\begin{example}[side-by-side]
+ single: \ch{CH3-CH3} \par
+ double: \ch{CH2=CH2} \par
+ triple: \ch{CH+CH}
+\end{example}
\subsubsection{Flexible Bonds}
\paragraph{Predefined Bonds}
In addition to the three native bonds there are a few more which can be called
by
-\begin{beschreibung}
- \Befehl{bond}{<bond name>}
-\end{beschreibung}
-The predefined bond types are shown in table~\ref{tab:bond_types}.
+\begin{commands}
+ \command{bond}[\marg{bond name}]
+ Prints the bond type specified by \meta{bond name}.
+\end{commands}
+The predefined bond types are shown in table~\vref{tab:bond_types}.
\begin{table}
- \centering
- \caption{Bonds available with \protect\cmd{bond}.}
- \label{tab:bond_types}
- \begin{tabular}{lcl}
- \toprule
- \bfseries name & \bfseries appearance & \bfseries aliases \\
- \midrule
- \code{single} & \bond{single} & \code{normal}, \code{sb} \\
- \code{double} & \bond{double} & \code{db} \\
- \code{triple} & \bond{triple} & \code{tp} \\
- \code{dotted} & \bond{dotted} & \code{semisingle} \\
- \code{deloc} & \bond{deloc} & \code{semidouble} \\
- \code{tdeloc} & \bond{tdeloc} & \code{semitriple} \\
- \code{co>} & \bond{co>} & \code{coordright} \\
- \code{<co} & \bond{<co} & \code{coordleft} \\
- \bottomrule
- \end{tabular}
+ \centering
+ \caption{Bonds available with \cs*{bond}.}
+ \label{tab:bond_types}
+ \begin{tabular}{lcl}
+ \toprule
+ \bfseries name & \bfseries appearance & \bfseries aliases \\
+ \midrule
+ \code{single} & \bond{single} & \code{normal}, \code{sb} \\
+ \code{double} & \bond{double} & \code{db} \\
+ \code{triple} & \bond{triple} & \code{tp} \\
+ \code{dotted} & \bond{dotted} & \code{semisingle} \\
+ \code{deloc} & \bond{deloc} & \code{semidouble} \\
+ \code{tdeloc} & \bond{tdeloc} & \code{semitriple} \\
+ \code{co>} & \bond{co>} & \code{coordright} \\
+ \code{<co} & \bond{<co} & \code{coordleft} \\
+ \bottomrule
+ \end{tabular}
\end{table}
-\begin{beispiel}
- \ch{C\bond{sb}C\bond{db}C\bond{tp}C\bond{deloc}C\bond{tdeloc}C\bond{co>}C\bond{<co}C}
-\end{beispiel}
+\begin{example}
+ \ch{C\bond{sb}C\bond{db}C\bond{tp}C\bond{deloc}C\bond{tdeloc}C\bond{co>}C\bond{<co}C}
+\end{example}
\paragraph{Own Bonds}
\chemformula\ offers commands to define own bond types:
-\begin{beschreibung}
- \Befehl{DeclareChemBond}{<name>}\ma{<code>}
- \Befehl{RenewChemBond}{<name>}\ma{<code>}
- \Befehl{DeclareChemBondAlias}{<new name>}\ma{<old name>}
- \Befehl{ShowChemBond}{<name>}
-\end{beschreibung}
+\begin{commands}
+ \command{DeclareChemBond}[\marg{name}\marg{code}]
+ Define the new bond type \meta{name}.
+ \command{RenewChemBond}[\marg{name}\marg{code}]
+ Redefine the existing bond type \meta{name}.
+ \command{DeclareChemBondAlias}[\marg{new name}\marg{old name}]
+ Declare the bond type \meta{new name} to be an alias of \meta{old name}.
+ \command{ShowChemBond}[\marg{name}]
+ Print the definition of bond type \meta{name}.
+\end{commands}
The usage is best described with an example. So let's see how the
\code{single} bond and the \code{co>} bond are defined:
-\begin{beispiel}[code only]
- \DeclareChemBond{single}
- { \draw[chembond] (chemformula-bond-start) -- (chemformula-bond-end) ; }
- \DeclareChemBond{coordright}
- { \draw[chembond,butt cap->] (chemformula-bond-start) -- (chemformula-bond-end) ; }
- \DeclareChemBondAlias{co>}{coordright}
-\end{beispiel}
+\begin{sourcecode}
+ \DeclareChemBond{single}
+ { \draw[chembond] (chemformula-bond-start) -- (chemformula-bond-end) ; }
+ \DeclareChemBond{coordright}
+ {
+ \draw[chembond,butt cap->]
+ (chemformula-bond-start) -- (chemformula-bond-end) ;
+ }
+ \DeclareChemBondAlias{co>}{coordright}
+\end{sourcecode}
Two points are important: the names of the starting and the ending
coordinates, \code{chemformula-bond-start} and \code{chemformula-bond-end},
-and the \TikZ style of the bonds \code{chembond}.
+and the \TikZ\ style of the bonds \code{chembond}.
So, let's say you want to define a special kind of dashed bond. You could do
this:
-\begin{beispiel}
- \usetikzlibrary{decorations.pathreplacing}
- \makeatletter
- \DeclareChemBond{dashed}
- {
- \draw[
- chembond,
- decorate,
- decoration={ticks,segment length=\chemformula@bondlength/10,amplitude=1.5pt}]
- (chemformula-bond-start) -- (chemformula-bond-end) ;
- }
- \makeatother
- \chemsetup[chemformula]{bond-length=2ex}
- \ch{C\bond{dashed}C}
-\end{beispiel}
-
-The last example showed you another macro:
-\makeatletter\cmd{chemformula@bondlength}\makeatother. It only exists so you
-can use it to access the bond length as set with \key{bond-length}
-directly.
-
-\subsection{Customization}\secidx[customization]{Compounds}\label{ssec:compounds:customization}
+\begin{example}
+ \usetikzlibrary{decorations.pathreplacing}
+ \makeatletter
+ \DeclareChemBond{dashed}
+ {
+ \draw[
+ chembond,
+ decorate,
+ decoration={
+ ticks,
+ segment length=\chemformula@bondlength/10,amplitude=1.5pt
+ }]
+ (chemformula-bond-start) -- (chemformula-bond-end) ;
+ }
+ \makeatother
+ \chemsetup[chemformula]{bond-length=2ex}
+ \ch{C\bond{dashed}C}
+\end{example}
+
+The last example showed you another macro: \verbcode+\chemformula@bondlength+.
+It only exists so you can use it to access the bond length as set with
+\option{bond-length} directly.
+
+\subsection{Customization}\label{ssec:compounds:customization}
These options allow you to customize the ouptut of the compounds:
-\begin{beschreibung}
- \Option{subscript-vshift}{<dim>}\Default{0pt}
- Extra vertical shift of the subscripts.
- \Option{subscript-style}{text|math}\Default{text}
- Style that is used to typeset the subscripts.
- \Option{charge-hshift}{<dim>}\Default{.25em}
- Shift of superscripts when following a subscript.\label{desc:charge-hshift}
- \Option{charge-vshift}{<dim>}\Default{0pt}
- Extra vertical shift of the superscripts.
- \Option{charge-style}{text|math}\Default{text}
- Style that is used to typeset the superscripts.
- \Option{adduct-space}{<dim>}\Default{.1333em}
- Space to the left and the right of the adduct point.
- \Option{bond-length}{<dim>}\Default{.5833em}
- The length of the bonds.
- \Option{bond-offset}{<dim>}\Default{.07em}
- Space between bond and atoms.
- \Option{bond-style}{<tikz>}\Default{}
- \TikZ\ options for the bonds.
- \Option{bond-penalty}{<num>}\Default{10000}
- \sinceversion{4.0a}The penalty that is inserted after a bond for
- (dis-)allowing line breaks.
- \Option{radical-style}{<tikz>}\Default{}
- \TikZ\ options for the radical point.
- \Option{radical-radius}{<dim>}\Default{.2ex}
- The radius of the radical point.
- \Option{radical-hshift}{<dim>}\Default{.15em}
- Horizontal shift before the radical point is drawn.
- \Option{radical-vshift}{<dim>}\Default{.5ex}
- Vertical shift relative to the current baseline.
- \Option{radical-space}{<dim>}\Default{.15em}
- Horizontal shift after the radical point is drawn.
-\end{beschreibung}
+\begin{options}
+ \keyval{subscript-vshift}{dim}\Default{0pt}
+ Extra vertical shift of the subscripts.
+ \keychoice{subscript-style}{text,math}\Default{text}
+ Style that is used to typeset the subscripts.
+ \keyval{charge-hshift}{dim}\Default{.25em}
+ Shift of superscripts when following a subscript.\label{desc:charge-hshift}
+ \keyval{charge-vshift}{dim}\Default{0pt}
+ Extra vertical shift of the superscripts.
+ \keychoice{charge-style}{text,math}\Default{text}
+ Style that is used to typeset the superscripts.
+ \keyval{adduct-space}{dim}\Default{.1333em}
+ Space to the left and the right of the adduct point.
+ \keyval{bond-length}{dim}\Default{.5833em}
+ The length of the bonds.
+ \keyval{bond-offset}{dim}\Default{.07em}
+ Space between bond and atoms.
+ \keyval{bond-style}{\TikZ}\Default
+ \TikZ\ options for the bonds.
+ \keyval{bond-penalty}{num}\Default{10000}
+ \sinceversion{4.0a}The penalty that is inserted after a bond for
+ (dis-)allowing line breaks.
+ \keyval{radical-style}{\TikZ}\Default
+ \TikZ\ options for the radical point.
+ \keyval{radical-radius}{dim}\Default{.2ex}
+ The radius of the radical point.
+ \keyval{radical-hshift}{dim}\Default{.15em}
+ Horizontal shift before the radical point is drawn.
+ \keyval{radical-vshift}{dim}\Default{.5ex}
+ Vertical shift relative to the current baseline.
+ \keyval{radical-space}{dim}\Default{.15em}
+ Horizontal shift after the radical point is drawn.
+\end{options}
Maybe you have noticed that charges of certain ions are shifted to the
-right.\secidx[charges!shift]{Compounds}
-\begin{beispiel}
- \ch{SO4^2-} \ch{NH4+} \ch{Na+}
-\end{beispiel}
+right.
+\begin{example}[side-by-side]
+ \ch{SO4^2-} \ch{NH4+} \ch{Na+}
+\end{example}
They are shifted if they \emph{follow} a subscript which follows \ac{iupac}
recommendations~\cite[][p.\,51]{iupac:greenbook}. The amount of the shift can
be set with the option \key{charge-hshift}.
-\begin{beispiel}
- \ch{SO4^2-} \ch{NH4+} \ch{Na+} \\
- \chemsetup[chemformula]{charge-hshift=.5ex}
- \ch{SO4^2-} \ch{NH4+} \ch{Na+} \\
- \chemsetup[chemformula]{charge-hshift=.5pt}
- \ch{SO4^2-} \ch{NH4+} \ch{Na+}
-\end{beispiel}
+\begin{example}
+ \ch{SO4^2-} \ch{NH4+} \ch{Na+} \par
+ \chemsetup[chemformula]{charge-hshift=.5ex}
+ \ch{SO4^2-} \ch{NH4+} \ch{Na+} \par
+ \chemsetup[chemformula]{charge-hshift=.5pt}
+ \ch{SO4^2-} \ch{NH4+} \ch{Na+}
+\end{example}
Despite \ac{iupac}'s recommendation \chemformula\ does not make fully staggered
arrangements in the default setting as I find it hard to read in some cases
and ugly in others. Since this is a subjective decision \chemformula\ not only
let's you define the absolute amount of the shift but also provides a
possibility for full staggered arrangements. For this you have to use
-\key{charge-hshift}{full}.
-\begin{beispiel}
- \ch[charge-hshift=0pt]{C5H11+} \ch[charge-hshift=0pt]{SO4^2-} \\
- \ch{C5H11+} \ch{SO4^2-} \\
- \ch[charge-hshift=1ex]{C5H11+} \ch[charge-hshift=1ex]{SO4^2-} \\
- \ch[charge-hshift=full]{C5H11+} \ch[charge-hshift=full]{SO4^2-}
-\end{beispiel}
+\keyis{charge-hshift}{full}.
+\begin{example}
+ \ch[charge-hshift=0pt]{C5H11+} \ch[charge-hshift=0pt]{SO4^2-} \par
+ \ch{C5H11+} \ch{SO4^2-} \par
+ \ch[charge-hshift=1ex]{C5H11+} \ch[charge-hshift=1ex]{SO4^2-} \par
+ \ch[charge-hshift=full]{C5H11+} \ch[charge-hshift=full]{SO4^2-}
+\end{example}
If you don't want the charges to be typeset in text mode you can switch to
math mode:
-\begin{beispiel}
- \ch{M^x+} \ch{SO4^2-} \\
- \chemsetup[chemformula]{charge-style = math}
- \ch{M^x+} \ch{SO4^2-}
-\end{beispiel}
-
-The option \key{subscript-vshift} can be used to adjust the vertical shift of
-the subscripts:\secidx[subscripts!shift]{Compounds}
-\begin{beispiel}
- \ch{H2SO4} \ch{Na3PO4} \\
- \chemsetup[chemformula]{subscript-vshift=.5ex}
- \ch{H2SO4} \ch{Na3PO4} \\
- \chemsetup[chemformula]{subscript-vshift=-.2ex}
- \ch{H2SO4} \ch{Na3PO4}
-\end{beispiel}
+\begin{example}
+ \ch{M^x+} \ch{SO4^2-} \par
+ \chemsetup[chemformula]{charge-style = math}
+ \ch{M^x+} \ch{SO4^2-}
+\end{example}
+
+The option \option{subscript-vshift} can be used to adjust the vertical shift
+of the subscripts:
+\begin{example}
+ \ch{H2SO4} \ch{Na3PO4} \par
+ \chemsetup[chemformula]{subscript-vshift=.5ex}
+ \ch{H2SO4} \ch{Na3PO4} \par
+ \chemsetup[chemformula]{subscript-vshift=-.2ex}
+ \ch{H2SO4} \ch{Na3PO4}
+\end{example}
You can choose the mode subscripts are typeset in the same way as it is
possible for the charges:
-\begin{beispiel}
- \ch{A_nB_m} \ch{H2SO4} \\
- \chemsetup[chemformula]{subscript-style = math}
- \ch{A_nB_m} \ch{H2SO4}
-\end{beispiel}
+\begin{example}
+ \ch{A_nB_m} \ch{H2SO4} \par
+ \chemsetup[chemformula]{subscript-style = math}
+ \ch{A_nB_m} \ch{H2SO4}
+\end{example}
-The option \key{adduct-space} sets the space left and right to the adduct
+The option \option{adduct-space} sets the space left and right to the adduct
symbol $\cdot$.
-\begin{beispiel}
- \ch{Na3PO3*H2O} \\
- \chemsetup[chemformula]{adduct-space=.2em}
- \ch{Na3PO3*H2O}
-\end{beispiel}
-
-Changing the length of the bonds:\secidx[bonds!length]{Compounds}
-\begin{beispiel}
- \chemsetup[chemformula]{bond-length=4mm}%
- single: \ch{CH3-CH3} \\
- double: \ch{CH2=CH2} \\
- triple: \ch{CH+CH}
-\end{beispiel}
+\begin{example}
+ \ch{Na3PO3*H2O} \par
+ \chemsetup[chemformula]{adduct-space=.2em}
+ \ch{Na3PO3*H2O}
+\end{example}
+
+Changing the length of the bonds:
+\begin{example}
+ \chemsetup[chemformula]{bond-length=4mm}%
+ single: \ch{CH3-CH3} \par
+ double: \ch{CH2=CH2} \par
+ triple: \ch{CH+CH}
+\end{example}
You can change the distance between bond and atom, too:
-\begin{beispiel}
- \ch{H-H + N+N + O=O} \\
- \ch[bond-offset=1pt]{H-H + N+N + O=O}
-\end{beispiel}
-
-\subsection{Standalone Formulae}\secidx[standalone]{Compounds}
-\noindent\sinceversion{4.0}\chemformula\ offers a command that \emph{only
- accepts} the \enquote{compound} input type:
-\begin{beschreibung}
- \Befehl{chcpd}[<options>]{<compound>}
-\end{beschreibung}
-\secidx*{Compounds}
-
-\section{Special Input Types}\secidx{Special Types}
+\begin{example}
+ \ch{H-H + N+N + O=O} \par
+ \ch[bond-offset=1pt]{H-H + N+N + O=O}
+\end{example}
+
+\subsection{Standalone Formulae}
+\chemformula\sinceversion{4.0} offers a command that \emph{only accepts} the
+\enquote{compound} input type:
+\begin{commands}
+ \command{chcpd}[\oarg{options}\marg{compound}]
+ Typeset single compounds.
+\end{commands}
+
+\section{Special Input Types}
There are some \enquote{special type} input groups.
-\subsection{Single Token Groups}\secidx[single token groups]{Special Types}
+\subsection{Single Token Groups}
The first kind are groups which consist of only one token, namely of the
following ones:
-\begin{beschreibung}
- \Befehl{ch}{ + } \ch{ + }\newline
- Creates the plus sign between compounds with space around it:\\
- \cmd{ch}{2 Na + Cl2} \ch{2 Na + Cl2}
- \Befehl{ch}{ v } \ch{ v }\newline
- Sign for precipitate: \cmd{ch}{BaSO4 v} \ch{BaSO4 v}
- \Befehl{ch}{ \lstinline+^+ } \ch{ ^ }\newline
- Sign for escaping gas\footnotemark: \cmd{ch}{\lstinline=H2 ^=}
- \ch{H2 ^}
-\end{beschreibung}
+\begin{commands}
+ \command{ch}[\marg{ + } \ch{ + }]
+ Creates the plus sign between compounds with space around it:\\
+ \cs{ch}\Marg{2 Na + Cl2} \ch{2 Na + Cl2}
+ \command{ch}[\Marg{ v } \ch{ v }]
+ Sign for precipitate: \cs{ch}\Marg{BaSO4 v} \ch{BaSO4 v}
+ \command{ch}[\Marg{ \textasciicircum\ } \ch{ ^ }]
+ Sign for escaping gas\footnotemark: \cs{ch}\Marg{H2 \textasciicircum}
+ \ch{H2 ^}
+\end{commands}
\footnotetext{Is this the correct English term? Please correct me if it isn't.}
The space left and right of the plus sign can be set with this option:
-\begin{beschreibung}
- \Option{plus-space}{<skip>}\Default{.3em plus .1em minus .1em}
- A rubber length.
- \Option{plus-penalty}{<num>}\Default{700}
- \sinceversion{4.0a}The penalty that is inserted after the plus sign for
- (dis-)allowing line breaks.
-\end{beschreibung}
-\begin{beispiel}
- \ch{A + B}\\
- \ch[plus-space=4pt]{A + B}
-\end{beispiel}
-
-\subsection{Option Input}\secidx[option input]{Special Types}
+\begin{options}
+ \keyval{plus-space}{skip}\Default{.3em plus .1em minus .1em}
+ A rubber length.
+ \keyval{plus-penalty}{num}\Default{700}
+ \sinceversion{4.0a}The penalty that is inserted after the plus sign for
+ (dis-)allowing line breaks.
+\end{options}
+\begin{example}[side-by-side]
+ \ch{A + B}\par
+ \ch[plus-space=4pt]{A + B}
+\end{example}
+
+\subsection{Option Input}
Sometimes you might want to apply an option only to a part of a, say,
-reaction. Of course you have the possibility to use \cmd{ch} several times.
-\begin{beispiel}
- \ch{H2O +}\textcolor{red}{\ch{H2SO4}}\ch{-> H3O+ + HSO4-} \\
- \ch{H2O +}\ch[subscript-vshift=2pt]{H2SO4}\ch{-> H3O+ + HSO4-}
-\end{beispiel}
+reaction. Of course you have the possibility to use \cs{ch} several times.
+\begin{example}
+ \ch{H2O +}\textcolor{red}{\ch{H2SO4}}\ch{-> H3O+ + HSO4-} \par
+ \ch{H2O +}\ch[subscript-vshift=2pt]{H2SO4}\ch{-> H3O+ + HSO4-}
+\end{example}
This, however, interrupts the input in your source and \emph{may} mess with
the spacing. That's why there is an alternative:
-\begin{beschreibung}\makeatletter
- \Befehl{ch}{ @\{<options>\} }\newline
- The options specified this way will be valid \emph{only} until the next
- compound is set.
-\end{beschreibung}
-\begin{beispiel}
- \ch{H2O +}\textcolor{red}{\ch{H2SO4}}\ch{-> H3O+ + HSO4-} \\
- \ch{H2O + @{format=\color{red}} H2SO4 -> H3O+ + HSO4-} \\
- or of course:\\
- \ch{H2O + \textcolor{red}{H2SO4} -> H3O+ + HSO4-}\\[1em]
- \ch{H2O +}\ch[subscript-vshift=2pt]{H2SO4}\ch{-> H3O+ + HSO4-} \\
- \ch{H2O + @{subscript-vshift=2pt} H2SO4 -> H3O+ + HSO4-}
-\end{beispiel}
-\secidx*{Special Types}
-
-\section{Escaped Input}\secidx{Escaped Input}
+\begin{commands}
+ \command{ch}[\Marg{ @\marg{options} }]
+ The options specified this way will be valid \emph{only} until the next
+ compound is set.
+\end{commands}
+\begin{example}
+ \ch{H2O +}\textcolor{red}{\ch{H2SO4}}\ch{-> H3O+ + HSO4-} \par
+ \ch{H2O + @{format=\color{red}} H2SO4 -> H3O+ + HSO4-} \par
+ or of course:\par
+ \ch{H2O + \textcolor{red}{H2SO4} -> H3O+ + HSO4-}\par\bigskip
+ \ch{H2O +}\ch[subscript-vshift=2pt]{H2SO4}\ch{-> H3O+ + HSO4-} \par
+ \ch{H2O + @{subscript-vshift=2pt} H2SO4 -> H3O+ + HSO4-}
+\end{example}
+
+\section{Escaped Input}
In some cases it may be desirable to prevent \chemformula\ from parsing the
input. This can be done in two ways.
-\subsection{Text}\label{ssec:text}\secidx[text]{Escaped Input}
-If you put something between \lstinline+" "+ or \lstinline+' '+ then the input
+\subsection{Text}\label{ssec:text}
+If you put something between \verbcode+" "+ or \verbcode+' '+ then the input
will be treated as normal text, except that spaces are not allowed and have to
-be input with \lstinline+~+.
-\begin{beschreibung}
- \Befehl{ch}{ "<escaped text>" }
- \Befehl{ch}{ '<escaped text>' }
-\end{beschreibung}
-\begin{beispiel}
- \ch{"\ox{2,Ca}" O} \\
- \ch{"\ldots\," Na + "\ldots\," Cl2 -> "\ldots\," NaCl} \\
- \ch{'A~->~B'}
-\end{beispiel}
+be input with \verbcode+~+.
+\begin{commands}
+ \command{ch}[\Marg{ "\meta{escaped text}" }]
+ One of two possibilities to \emph{escape} \chemformula's parsing.
+ \command{ch}[\Marg{ '\meta{escaped text}' }]
+ The second of two possibilities to \emph{escape} \chemformula's parsing.
+\end{commands}
+\begin{example}
+ \ch{"\ox{2,Ca}" O} \par
+ \ch{"\ldots\," Na + "\ldots\," Cl2 -> "\ldots\," NaCl} \par
+ \ch{'A~->~B'}
+\end{example}
In many cases you won't need to escape the input. But when you get into
-trouble when using a command inside \cmd{ch} try hiding it.
+trouble when using a command inside \cs{ch} try hiding it.
-\subsection{Math}\secidx[math]{Escaped Input}
-If you especially want to input math you just enclose it with \lstinline+$ $+.
+\subsection{Math}
+If you especially want to input math you just enclose it with \verbcode+$ $+.
This output is different from the escaped text as it is followed by a space.
The reasoning behind this is that I assume math will mostly be used to replace
stoichiometric factors.
-\begin{beschreibung}
- \Befehl{ch}{ \string$<escaped math>\string$ }
- \Befehl{ch}{ \string\(<escaped math>\string\) }
-\end{beschreibung}
-\begin{beispiel}
- escaped text: \ch{"$x$" H2O} \\
- escaped math: \ch{$x$ H2O} \\
- also escaped math: \ch{\(x\) H2O} \\
- \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl}
-\end{beispiel}
+\begin{commands}
+ \command{ch}[\Marg{ \string$\meta{escaped math}\string$ }]
+ One of two possibilities to \emph{escape} \chemformula's parsing into math
+ mode.
+ \command{ch}[\Marg{ \string\(\meta{escaped math}\string\) }]
+ The second of two possibilities to \emph{escape} \chemformula's parsing
+ into math mode.
+\end{commands}
+\begin{example}[side-by-side]
+ escaped text: \ch{"$x$" H2O} \par
+ escaped math: \ch{$x$ H2O} \par
+ also escaped math: \ch{\(x\) H2O} \par
+ \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl}
+\end{example}
The space that is inserted after a math group can be edited:
-\begin{beschreibung}
- \Option{math-space}{<skip>}\Default{.1667em plus .0333em minus .0117em}
+\begin{options}
+ \keyval{math-space}{skip}\Default{.1667em plus .0333em minus .0117em}
A rubber length.
-\end{beschreibung}
-\begin{beispiel}
- \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl} \\
- \chemsetup[chemformula]{math-space=.25em}
- \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl} \\
- \ch{$A->B$}
-\end{beispiel}
-\secidx*{Escaped Input}
-
-\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}.
+\end{options}
+\begin{example}
+ \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl} \par
+ \chemsetup[chemformula]{math-space=.25em}
+ \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl} \par
+ \ch{$A->B$}
+\end{example}
+
+\section{Arrows}\label{sec:arrows}
+\subsection{Arrow types}
+Arrows are input in the same intuitive way they are with \pkg{mhchem}.
There are various different types:
-\begin{beschreibung}
- \Befehl{ch}{ -> } \ch{->}\newline
- standard right arrow
- \Befehl{ch}{ <- } \ch{<-}\newline
- standard left arrow
- \Befehl{ch}{ -/> } \ch{-/>}\newline
- does not react (right)
- \Befehl{ch}{ </- } \ch{</-}\newline
- does not react (left)
- \Befehl{ch}{ <-> } \ch{<->}\newline
- resonance arrow
- \Befehl{ch}{ <> } \ch{<>}\newline
- reaction in both directions
- \Befehl{ch}{ == } \ch{==}\newline
- stoichiometric equation
- \Befehl{ch}{ <=> } \ch{<=>}\newline
- equilibrium arrow
- \Befehl{ch}{ \lstinline+<=>>+ } \ch{<=>>}\newline
- unbalanced equilibrium arrow to the right
- \Befehl{ch}{ \lstinline+<<=>+ } \ch{<<=>}\newline
- unbalanced equilibrium arrow to the left
- \Befehl{ch}{ <o> } \ch{<o>}\newline
- isolobal arrow
-\end{beschreibung}
+\begin{commands}
+ \command{ch}[\Marg{ -> } \ch{->}]
+ standard right arrow
+ \command{ch}[\Marg{ <- } \ch{<-}]
+ standard left arrow
+ \command{ch}[\Marg{ -/> } \ch{-/>}]
+ does not react (right)
+ \command{ch}[\Marg{ </- } \ch{</-}]
+ does not react (left)
+ \command{ch}[\Marg{ <-> } \ch{<->}]
+ resonance arrow
+ \command{ch}[\Marg{ <> } \ch{<>}]
+ reaction in both directions
+ \command{ch}[\Marg{ == } \ch{==}]
+ stoichiometric equation
+ \command{ch}[\Marg{ <=> } \ch{<=>}]
+ equilibrium arrow
+ \command{ch}[\Marg{ <=>> } \ch{<=>>}]
+ unbalanced equilibrium arrow to the right
+ \command{ch}[\Marg{ <<=> } \ch{<<=>}]
+ unbalanced equilibrium arrow to the left
+ \command{ch}[\Marg{ <o> } \ch{<o>}]
+ isolobal arrow
+\end{commands}
All these arrows are drawn with \TikZ.
-\begin{beispiel}
- \ch{H2 + Cl2 -> 2 HCl} \\
- \ch{H2O + CO3^2- <=> OH- + HCO3-} \\
- \ch{A <- B} \\
- \ch{\{[CH2=CH-CH2]- <-> [CH2-CH=CH2]- \}} \\
- \ch{A <> B} \\
- \ch{H+ + OH- <=>> H2O} \\
- \ch{2 NO2 <<=> N2O4}
-\end{beispiel}
-
-% TODO: add description for \charrow
-
-\subsection{Labels}\secidx[labels]{Arrows}
+\begin{example}
+ \ch{H2 + Cl2 -> 2 HCl} \par
+ \ch{H2O + CO3^2- <=> OH- + HCO3-} \par
+ \ch{A <- B} \par
+ \ch{\{[CH2=CH-CH2]- <-> {}[CH2-CH=CH2]- \}} \par
+ \ch{A <> B} \par
+ \ch{H+ + OH- <=>> H2O} \par
+ \ch{2 NO2 <<=> N2O4}
+\end{example}
+
+\subsection{Labels}
The arrows take two optional arguments to label them.
-\begin{beschreibung}
- \Befehl{ch}{ ->[<above>][<below>] }
-\end{beschreibung}
-\begin{beispiel}
- \ch{A ->[a] B} \\
- \ch{A ->[a][b] B} \\
- \ch{A ->[\SI{100}{\celsius}] B}
-\end{beispiel}
+\begin{commands}
+ \command{ch}[\Marg{ ->[\meta{above}][\meta{below}] }]
+ Add text above or under an arrow.
+\end{commands}
+\begin{example}[side-by-side]
+ \ch{A ->[a] B} \par
+ \ch{A ->[a][b] B} \par
+ \ch{A ->[\SI{100}{\celsius}] B}
+\end{example}
The label text can be parsed seperately from the arrow. The recipe is easy:
leave blanks.
-\begin{beispiel}
- \ch{A ->[H2O] B} \\
- \ch{A ->[ H2O ] B} \\
- \ch{A ->[ "\ox{2,Ca}" F2 ] B} \\
- \ch{A ->[$\Delta$,~ \[H+ \]] B}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ch{A ->[H2O] B} \par
+ \ch{A ->[ H2O ] B} \par
+ \ch{A ->[ "\ox{2,Ca}" F2 ] B} \par
+ \ch{A ->[$\Delta$,~ \[H+ \]] B}
+\end{example}
% TODO: correct info about []
If you leave the blanks \chemformula\ treats the groups inside the square
@@ -1020,180 +1014,210 @@ 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} \\
- \ch{A ->[abc] B} \\
- \ch{A ->[abc~abc] B} \\
- % needs the `chemfig' package:
- \setatomsep{15pt}
- \ch{A ->[ "\chemfig{-[:30]-[:-30]OH}" ] B} \\
- \ch{A ->[[]] B} vs. \ch{A ->[\[\]] B}
-\end{beispiel}
-
-\subsection{Customization}\secidx[customization]{Arrows}
+arguments should be produced using \cs*{[} and \cs*{]}. They keep their usual
+meaning outside \cs{ch}. These commands are necessary since the usual
+grouping (\ie, hiding the brackets inside curly brackets) doesn't work due to
+the way \cs{ch} reads its argument.
+\begin{example}
+ \ch{A ->[a] B} \par
+ \ch{A ->[ab] B} \par
+ \ch{A ->[abc] B} \par
+ \ch{A ->[abc~abc] B} \par
+ % needs the `chemfig' package:
+ \setatomsep{15pt}
+ \ch{A ->[ "\chemfig{-[:30]-[:-30]OH}" ] B} \par
+ \ch{A ->[[]] B} vs. \ch{A ->[\[\]] B}
+\end{example}
+
+\subsection{Customization}
These are the options which enable you to customize the arrows:
-\begin{beschreibung}
- \Option{arrow-offset}{<dim>}\Default{.75em}
- This is the length that an arrow protrudes a label on both sides. This
- means an empty arrow's length is two times \code{arrow-offset}.
- \Option{arrow-min-length}{<dim>}\Default{0pt}
- \sinceversion{3.6b}The minimal length an error must have unless two times
- \key{arrow-offset}
- plus the width of the label is larger.
- \Option{arrow-yshift}{<dim>}\Default{0pt}
- Shifts an arrow up (positive value) or down (negative value).
- \Option{arrow-ratio}{<factor>}\Default{.6}
- The ratio of the arrow lengths of the unbalanced equilibrium. \code{.4}
- would mean that the length of the shorter arrow is $0.4\times$ the length
- of the longer arrow.
- \Option{compound-sep}{<dim>}\Default{.5em}
- The space between compounds and the arrows.
- \Option{label-offset}{<dim>}\Default{2pt}
- The space between the labels and the arrows.
- \Option{label-style}{<font command>}\Default{\cmd*{footnotesize}}
- The relative font size of the labels.
- \Option{arrow-penalty}{<num>}\Default{0}
- \sinceversion{4.0a}The penalty that is inserted after an arrow for
- (dis-)allowing line breaks.
-\end{beschreibung}
-
-The following code shows the effect of the different options on the \lstinline+<=>>+
+\begin{options}
+ \keyval{arrow-offset}{dim}\Default{.75em}
+ This is the length that an arrow protrudes a label on both sides. This
+ means an empty arrow's length is two times \code{arrow-offset}.
+ \keyval{arrow-min-length}{dim}\Default{0pt}
+ \sinceversion{3.6b}The minimal length an error must have unless two times
+ \key{arrow-offset} plus the width of the label is larger.
+ \keyval{arrow-yshift}{dim}\Default{0pt}
+ Shifts an arrow up (positive value) or down (negative value).
+ \keyval{arrow-ratio}{<factor>}\Default{.6}
+ The ratio of the arrow lengths of the unbalanced equilibrium. \code{.4}
+ would mean that the length of the shorter arrow is $0.4\times$ the length
+ of the longer arrow.
+ \keyval{compound-sep}{dim}\Default{.5em}
+ The space between compounds and the arrows.
+ \keyval{label-offset}{dim}\Default{2pt}
+ The space between the labels and the arrows.
+ \keyval{label-style}{font command}\Default{\cs*{footnotesize}}
+ The relative font size of the labels.
+ \keyval{arrow-penalty}{num}\Default{0}
+ \sinceversion{4.0a}The penalty that is inserted after an arrow for
+ (dis-)allowing line breaks.
+ \keyval{arrow-style}{\TikZ}\Default
+ \sinceversion{4.1a}Additonal \TikZ\ keys for formatting the arrows.
+\end{options}
+
+The following code shows the effect of the different options on the \verbcode+<=>>+
arrow:
-\begin{beispiel}
- standard: \ch{A <=>>[x][y] B} \\
- 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} \\
- labels further away: \ch[label-offset=4pt]{A <=>>[x][y] B} \\
- larger distance to compounds: \ch[compound-sep=2ex]{A <=>>[x][y] B} \\
- smaller labels: \ch[label-style=\tiny]{A <=>[x][y] B}
-\end{beispiel}
-
-\subsection{Modify Arrow Types}\label{sec:arrows_modify}\secidx[types!modify]{Arrows}
+\begin{example}
+ standard: \ch{A <=>>[x][y] B} \par
+ longer: \ch[arrow-offset=12pt]{A <=>>[x][y] B} \par
+ higher: \ch[arrow-yshift=2pt]{A <=>>[x][y] B} \par
+ more balanced: \ch[arrow-ratio=.8]{A <=>>[x][y] B} \par
+ labels further away: \ch[label-offset=4pt]{A <=>>[x][y] B} \par
+ larger distance to compounds: \ch[compound-sep=2ex]{A <=>>[x][y] B} \par
+ smaller labels: \ch[label-style=\tiny]{A <=>[x][y] B}
+\end{example}
+
+\subsection{Modify Arrow Types}\label{sec:arrows_modify}
The arrows are defined with the command
-\begin{beschreibung}
- \Befehl{DeclareChemArrow}{<tokens>}\ma{<tikz>}
-\end{beschreibung}
-\ma{<tokens>} is the sequence of tokens that is replaced with the actual arrow
+\begin{commands}
+ \command{DeclareChemArrow}[\marg{type}\marg{\TikZ}]
+ Define a new arrow type \meta{type}.
+\end{commands}
+\meta{type} 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}
+\begin{sourcecode}
+ \DeclareChemArrow{->}{
+ \draw[chemarrow,-cf] (cf_arrow_start) -- (cf_arrow_end) ;
+ }
+\end{sourcecode}
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[\code{(cf\_arrow\_start)}] The beginning of the arrow.
- \item[\code{(cf\_arrow\_end)}] The end of the arrow.
- \item[\code{(cf\_arrow\_mid)}] The mid of the arrow.
- \item[\code{(cf\_arrow\_mid\_start)}] The beginning of the shorter arrow in
- types like \lstinline+<=>>+.
- \item[\code{(cf\_arrow\_mid\_end)}] The end of the shorter arrow in types like
- \lstinline+<=>>+.
- \item[\code{cf}, \code{left cf}, \code{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);}
- \ch{A .> B} \ch{A .>[a][b] B} \ch{A n> B}
-\end{beispiel}
+\TikZ\footnote{Please see the \manual{pgfmanual} for details.}. The
+predefined arrows use the arrow tips \code{cf}, \code{left cf} and \code{right
+ cf}. They also all except the net reaction arrow \code{==} use the
+\TikZ-style \code{chemarrow} that you should use, too, if you want the option
+\option{arrow-style} to have an effect.
+
+There are some predefined coordinates you can and should use. For
+completeness' sake the arrow tips and the \TikZ-style are also listed:
+\begin{codedesc}
+ \Code{(cf\_arrow\_start)}
+ The beginning of the arrow.
+ \Code{(cf\_arrow\_end)}
+ The end of the arrow.
+ \Code{(cf\_arrow\_mid)}
+ The mid of the arrow.
+ \Code{(cf\_arrow\_mid\_start)}
+ The beginning of the shorter arrow in types like \verbcode+<=>>+.
+ \Code{(cf\_arrow\_mid\_end)}
+ The end of the shorter arrow in types like \verbcode+<=>>+.
+ \Code{cf}
+ A double-sided arrow tip.
+ \Code{left cf}
+ A left-sided arrow tip.
+ \Code{right cf}
+ A right-sided arrow tip.
+ \Code{chemarrow}
+ \chemformula's \TikZ-style that is applied to the arrows and set with
+ \option{arrow-style}
+\end{codedesc}
+\begin{example}
+ \DeclareChemArrow{.>}{
+ \draw[chemarrow,-cf,dotted,red] (cf_arrow_start) -- (cf_arrow_end);
+ }
+ \DeclareChemArrow{n>}{
+ \draw[chemarrow,-cf]
+ (cf_arrow_start)
+ .. controls ([yshift=3ex]cf_arrow_mid) ..
+ (cf_arrow_end);
+ }
+ \ch{A .> B} \ch{A .>[a][b] B} \ch{A n> B}
+\end{example}
If you want to redefine an existing arrow there are two commands you can use:
-\begin{beschreibung}
- \Befehl{RenewChemArrow}{<tokens>}\ma{<tikz>}
- \Befehl{ShowChemArrow}{<tokens>}
-\end{beschreibung}
+\begin{commands}
+ \command{RenewChemArrow}[\marg{type}\marg{\TikZ}]
+ Redefine the arrow type \meta{type}.
+ \command{ShowChemArrow}[\marg{type}]
+ Print out the current definition of the arrow type \meta{type}.
+\end{commands}
The second one gives the current definition, the first one redefines an existing
arrow.
-\begin{beispiel}
- \texttt{\ShowChemArrow{->}} \\
- \RenewChemArrow{->}{\draw[->,red] (cf_arrow_start) -- (cf_arrow_end) ;}
- \texttt{\ShowChemArrow{->}} \\
- \ch{A -> B}
-\end{beispiel}
-
-\subsection{Standalone Arrows}\secidx[standalone]{Arrows}
-\noindent\sinceversion{4.0}\chemformula\ offers a command that \emph{only
- accepts} the \enquote{arrow} input type:
-\begin{beschreibung}
- \Befehl{charrow}{<arrow>}\oa{<above>}\oa{<below>}
-\end{beschreibung}
-\secidx*{Arrows}
-
-\section{Names}\secidx{Names}
-\subsection{Syntax}\secidx[syntax]{Names}
+\begin{example}
+ \texttt{\ShowChemArrow{->}} \par
+ \RenewChemArrow{->}{\draw[chemarrow,->,red] (cf_arrow_start) -- (cf_arrow_end) ;}
+ \texttt{\ShowChemArrow{->}} \par
+ \ch{A -> B}
+\end{example}
+
+\subsection{Standalone Arrows}
+\chemformula\ offers\sinceversion{4.0} a command that \emph{only accepts} the
+\enquote{arrow} input type:
+\begin{commands}
+ \command{charrow}[\marg{type}\oarg{above}\oarg{below}]
+ Print the arrow type \meta{type}.
+\end{commands}
+This command is internally used for the arrows, too, when \cs{ch} is parsed.
+
+\section{Names}
+\subsection{Syntax}
\chemformula\ has a built-in syntax to write text under a compound. In a way
it works very similar to the arrows.
-\begin{beschreibung}
- \Befehl{ch}{ !(<name>)( <formula> ) }
-\end{beschreibung}
+\begin{commands}
+ \command{ch}[\Marg{ !(\meta{text})( \meta{formula} ) }]
+ Writes \meta{text} below \meta{formula}.
+\end{commands}
If an exclamation mark is followed by a pair of parentheses \chemformula\ will
parse it this way:
-\begin{beispiel}
- \ch{!(ethanol)( CH2CH2OH )}
-\end{beispiel}
+\begin{example}
+ \ch{!(ethanol)( CH2CH2OH )}
+\end{example}
The same what's true for the arrows arguments holds for these arguments: if
you leave blanks the different parts will be treated according to their input
type before the text is set below the formula.
-\begin{beispiel}
- \ch{!(water)(H2O)} \quad
- \ch{!( "\textcolor{blue}{water}" )( H2O )} \quad
- \ch{!( $2n-1$ )( H2O )} \quad
- \ch{!( H2O )( H2O )} \quad
- \ch{!(oxonium)( H3O+ )}
-\end{beispiel}
+\begin{example}
+ \ch{!(water)(H2O)} \quad
+ \ch{!( "\textcolor{blue}{water}" )( H2O )} \quad
+ \ch{!( $2n-1$ )( H2O )} \quad
+ \ch{!( H2O )( H2O )} \quad
+ \ch{!(oxonium)( H3O+ )}
+\end{example}
If for some reason you want to insert an exclamation mark \emph{without} it
creating a name you only have to make sure it isn't followed by parentheses.
-\begin{beispiel}
- \ch{H2O~(!)} \\
- \ch{A!{}()}
-\end{beispiel}
-
-% TODO add description of \chname command
+\begin{example}[side-by-side]
+ \ch{H2O~(!)} \par
+ \ch{A!{}()}
+\end{example}
-\subsection{Customization}\secidx[customization]{Names}
+\subsection{Customization}
\chemformula\ provides two options to customize the output of the names:
-\begin{beschreibung}
- \Option{name-format}{<commands>}\Default{\cmd*{scriptsize}\cmd*{centering}}
+\begin{options}
+ \keyval{name-format}{commands}\Default{\cs*{scriptsize}\cs*{centering}}
The format of the name. This can be arbitrary input.
- \Option{name-width}{<dim>|auto}\Default{auto}
+ \keychoice{name-width}{\meta{dim},auto}\Default{auto}
The width of the box where the label is put into. \code{auto} will detect
the width of the name and set the box to this width.
-\end{beschreibung}
-\begin{beispiel}
- \ch{!(acid)( H2SO4 ) -> B} \\
- \ch[name-format=\sffamily\small]{!(acid)( H2SO4 ) -> B} \\
- \ch[name-format=\scriptsize N:~]{!(acid)( H2SO4 ) -> B} \\
- \ch[name-width=3em,name-format=\scriptsize\raggedright]{!(acid)( H2SO4 ) -> B}
-\end{beispiel}
-
-\subsection{Standalone Names}\secidx[standalone]{Names}
-\noindent\sinceversion{4.0}\chemformula\ offers a command that allows the
-usage of the \enquote{name} syntax in normal text. This is the command that
-a bang is replaced with in \chemformula's formulas, actually. Both arguments
-are mandatory.
-\begin{beschreibung}
- \Befehl{chname}\da{<under>}\da{<text>}
-\end{beschreibung}
-\secidx*{Names}
-
-\section{Format and Font}\secidx{Format and Font}\label{sec:format}
+\end{options}
+\begin{example}
+ \ch{!(acid)( H2SO4 ) -> B} \par
+ \ch[name-format=\sffamily\small]{!(acid)( H2SO4 ) -> B} \par
+ \ch[name-format=\scriptsize N:~]{!(acid)( H2SO4 ) -> B} \par
+ \ch[name-width=3em,name-format=\scriptsize\raggedright]{!(acid)( H2SO4 ) -> B}
+\end{example}
+
+\subsection{Standalone Names}
+\chemformula\ offers a command\sinceversion{4.0} that allows the usage of the
+\enquote{name} syntax in normal text. This is the command that a bang is
+replaced with in \chemformula's formulas, actually. Both arguments are
+mandatory.
+\begin{commands}
+ \command{chname}[\darg{text~1}\darg{text~2}]
+ The command that is useed internally for placing \meta{text~1} below of
+ \meta{text~2}.
+\end{commands}
+
+\section{Format and Font}\label{sec:format}
In the standard setting \chemformula\ doesn't make any default changes to the
font of the formula output. Let's take a look at a nonsense input which shows
all features:
-\begin{beispiel}
- \newcommand*\sample{%
- \ch{H2C-C+C-CH=CH+ + CrO4^2-
- <=>[x][y]
- 2.5 Cl^{-.} + 3_1/2 Na*OH_{(aq)} + !(name)( A^n ) "\LaTeXe"}
- }
- \sample
-\end{beispiel}
+\begin{example}[pre-output={\biolinumLF\libertineLF\chemsetup{chemformula/format=}}]
+ \newcommand*\sample{%
+ \ch{H2C-C+C-CH=CH+ + CrO4^2-
+ <=>[x][y]
+ 2.5 Cl^{-.} + 3_1/2 Na*OH_{(aq)} + !(name)( A^n ) "\LaTeXe"}
+ }
+ \sample
+\end{example}
\newcommand*\sample{%
\ch{H2C-C+C-CH=CH+ + CrO4^2-
<=>[x][y]
@@ -1201,184 +1225,269 @@ all features:
}
Now we're going to change different aspects of the font a look what happens:
-\begin{beispiel}[below]
- \sffamily Hallo \sample \\
- \ttfamily Hallo \sample \normalfont \\
- \bfseries Hallo \sample \normalfont \\
- \itshape Hallo \sample
-\end{beispiel}
+\begin{example}[pre-output={\biolinumLF\libertineLF\chemsetup{chemformula/format=}}]
+ \sffamily Hallo \sample \\
+ \ttfamily Hallo \sample \normalfont \\
+ \bfseries Hallo \sample \normalfont \\
+ \itshape Hallo \sample
+\end{example}
As you can see most features adapt to the surrounding font.
If you want to change the default format you need to use this option:
-\begin{beschreibung}
- \Option{format}{<anything>}\Default{}
- Adds arbitrary code before the output of \cmd{ch}.
-\end{beschreibung}
-\begin{beispiel}
- \definecolor{newblue}{rgb}{.1,.1,.5}
- \chemsetup[chemformula]{format=\color{newblue}\sffamily}
- \sffamily Hallo \sample \\
- \ttfamily Hallo \sample \normalfont \\
- \bfseries Hallo \sample \normalfont \\
- \itshape Hallo \sample
-\end{beispiel}
+\begin{options}
+ \keyval{format}{anything}\Default
+ Adds arbitrary code before the output of \cs{ch}.
+\end{options}
+\begin{example}[pre-output={\biolinumLF\libertineLF\chemsetup{chemformula/format=}}]
+ \definecolor{newblue}{rgb}{.1,.1,.5}
+ \chemsetup[chemformula]{format=\color{newblue}\sffamily}
+ \sffamily Hallo \sample \\
+ \ttfamily Hallo \sample \normalfont \\
+ \bfseries Hallo \sample \normalfont \\
+ \itshape Hallo \sample
+\end{example}
You can also specifically change the fontfamily, fontseries and fontshape of
the output.
-\begin{beschreibung}
- \Option{font-family}{<family>}\Default{}
- Changes the fontfamily of the output with
- \lstinline+\fontfamily{<family>}\selectfont+.
- \Option{font-series}{<series>}\Default{}
- Changes the fontseries of the output with
- \lstinline+\fontseries{<series>}\selectfont+.
- \Option{font-shape}{<shape>}\Default{}
- Changes the fontshape of the output with
- \lstinline+\fontshape{<shape>}\selectfont+.
-\end{beschreibung}
-\begin{beispiel}
- \chemsetup[chemformula]{font-series=bx}
- Hallo \sample \\
- \sffamily Hallo \sample \normalfont \\
- \chemsetup[chemformula]{font-family=lmr,font-series=m} Hallo \sample \normalfont \\
- \itshape Hallo \sample
-\end{beispiel}
-
-If you're using \XeLaTeX\ or \LuaLaTeX\ and have loaded \paket{fontspec} you
+\begin{options}
+ \keyval{font-family}{family}\Default
+ Changes the fontfamily of the output with \cs*{fontfamily}\marg{family}.
+ \keyval{font-series}{series}\Default
+ Changes the fontseries of the output with \cs*{fontseries}\marg{series}.
+ \keyval{font-shape}{shape}\Default
+ Changes the fontshape of the output with \cs*{fontshape}\marg{shape}.
+\end{options}
+\begin{example}[pre-output={\biolinumLF\libertineLF\chemsetup{chemformula/format=}}]
+ \chemsetup[chemformula]{font-series=bx}
+ Hallo \sample \par
+ \sffamily Hallo \sample \normalfont \par
+ \chemsetup[chemformula]{font-family=lmss,font-series=m} Hallo \sample
+ \normalfont \par
+ \itshape Hallo \sample
+\end{example}
+
+If you're using \XeLaTeX\ or \LuaLaTeX\ and have loaded \pkg{fontspec} you
have the possibilty to set the font with it:
-\begin{beschreibung}
- \Option{font-spec}{\{<font>\}}\Default{}
- or with options
- \Option{font-spec}{\{[<options>]<font>\}}
-\end{beschreibung}
-\begin{beispiel}
- \chemsetup[chemformula]{font-spec={Linux Biolinum O}} \sample \\
- \chemsetup[chemformula]{font-spec={Augie}} \sample \\
- \chemsetup[chemformula]{font-spec={Latin Modern Sans}} \sample \\
- \bfseries \sample \normalfont
-\end{beispiel}
-\secidx*{Format and Font}
-
-\section{Usage In Math Equations}\secidx{Math Environments}
-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}
+\begin{options}
+ \keyval{font-spec}{font}\Default
+ Use font \meta{font} for \chemformula's formulas.
+\end{options}
+or with options
+\begin{options}
+ \keychoice{font-spec}{\Marg{[\meta{options}]\meta{font}}}
+ Use font \meta{font} with options \meta{options} for \chemformula's
+ formulas.
+\end{options}
+Since this document is typeset with \pdfLaTeX\ the option cannot be
+demonstrated here.
+
+\section{Usage In Math Equations}
+The \cs{ch} command can be used inside math equations. It recognizes
+\verbcode+\\+ and \verbcode+&+ and passes them on. However, you can't use the
+optional arguments of \verbcode+\\+ inside \cs{ch}.
+\begin{example}
+ \begin{align}
+ \ch{
+ H2O & ->[a] H2SO4 \\
+ Cl2 & ->[x][y] CH4
+ }
+ \end{align}
+ \begin{align*}
\ch{
- H2O & ->[a] H2SO4 \\
- Cl2 & ->[x][y] CH4
+ RNO2 &<=>[ + e- ] RNO2^{-.} \\
+ RNO2^{-.} &<=>[ + e- ] RNO2^2-
}
- \end{align}
- \begin{align*}
- \ch{
- RNO2 &<=>[ + e- ] RNO2^{-.} \\
- RNO2^{-.} &<=>[ + e- ] RNO2^2-
- }
- \end{align*}
-\end{beispiel}
-\secidx*{Math Environments}
-
-\section{Usage with \TikZ{} or \paket*{pgfplots} and externalization}
-\sinceversion{4.1}
-\noindent
-Since \chemformula{} uses \TikZ{} to draw reaction arrows and bonds they would
-be externalized, too, if you use that facility with \TikZ{} or
-\paket{pgfplots}\footnote{\CTANurl{pgfplots}}. This may not be desirable
-since they are very small pictures maybe containing of a single line. This is
-why \chemformula's default behaviour is to disable externalization for it's
-bonds and arrows. This can be turned on and off through the following option:
-\begin{beschreibung}
- \Option{tikz-external-disable}{\default{true}|false}\Default{true}
+ \end{align*}
+\end{example}
+
+\section{Usage with \TikZ{} or \pkg*{pgfplots} and externalization}
+Since \chemformula{} uses\sinceversion{4.1} \TikZ{} to draw reaction arrows
+and bonds they would be externalized, too, if you use that facility with
+\TikZ{} or \needpackage{pgfplots}~\cite{pkg:pgfplots}. This may not be
+desirable since they are very small pictures maybe containing of a single
+line. This is why \chemformula's default behaviour is to disable
+externalization for it's bonds and arrows. This can be turned on and off
+through the following option:
+\begin{options}
+ \keybool{tikz-external-disable}\Default{true}
dis- or enable \TikZ' externalization mechanism for \chemformula's arrows
and bonds.
-\end{beschreibung}
+\end{options}
If you should be using a formula that contains bonds or arrows inside of a
\code{tikzpicture} that is externalized you should locally enable it for
\chemformula, too:
-\begin{beispiel}[code only]
+\begin{sourcecode}
\begin{tikzpicture}
\setchemformula{tikz-external-disable=false}
\begin{axis}[xlabel={\ch{2 H+ + 2 e- -> H2}}]
\addplot ... ;
\end{axis}
\end{tikzpicture}
-\end{beispiel}
+\end{sourcecode}
+
+\section{Lewis Formulae}\label{sec:lewis-formulae}
+\chemformula\ offers\sinceversion{4.2} a command to typeset Lewis formulae.
+This does not mean Lewis structures! Those can be achieved using the
+\pkg{chemfig} package~\cite{pkg:chemfig}. \chemformula\ provides the
+possibility to draw electrons as dots and pairs of dots or a line around an
+atom.
+
+\begin{commands}
+ \command{chlewis}[\oarg{options}\marg{electron spec}\marg{atom}]
+ Draws electrons around the \meta{atom} according to \meta{electron spec}.
+\end{commands}
+
+Electrons are specified by the angle to the horizontal in the couter-clockwise
+direction. The default appearance is a pair of electrons drawn as a pair of
+dots. Other specifications can be chosen. The specification follows the
+pattern \meta{angle}\meta{separator}. \meta{angle} is a positiv or negativ
+integer denoting the angle counter clockwise to the horizontal where the
+electrons should be drawn. \meta{separator} is either a dot (\code{.}, single
+electron), a colon (\code{:}, electron pair), a vertical line (\code{|},
+electron pair), an o (\code{o}, empty pair), or a comma (\code{,} default
+spec).
+
+\begin{commands}
+ \command{chlewis}[\Marg{\meta{angle1}\meta{type1}\meta{angle2}\meta{type2}}%
+ \marg{atom}]
+ For example: \cs{chlewis}\Marg{0,180}\Marg{O} gives \chlewis{0,180}{O} and
+ \cs{chlewis}\Marg{0.90.180.270.}\Marg{C} gives
+ \chlewis{0.90.180.270.}{C}.
+\end{commands}
+
+The appearance can be influenced by a number of options:
+\begin{options}
+ \keychoice{lewis-default}{.,:,|,o,single,pair,pair (dotted),pair
+ (line),empty}\Default{pair}
+ Sets the default type that is used when no type is given in \meta{electron
+ spec}.
+ \keyval{lewis-distance}{dim}\Default{1ex}
+ The distance of two electrons in a pair.
+ \keyval{lewis-line-length}{dim}\Default{1.5ex}
+ The length of the line representing an electron pair.
+ \keyval{lewis-line-width}{dim}\Default{1pt}
+ The thickness of a line representing an electron pair.
+ \keyval{lewis-offset}{dim}\Default{.5ex}
+ The distance of the symbols from the atom.
+\end{options}
+The dots are drawn according to the \option{radical-radius} option mentioned
+in section~\ref{ssec:compounds:customization}.
+
+The basic usage should be more or less self-explaining:
+\begin{example}[side-by-side]
+ \chlewis{0:90|180.270}{O}
+ \quad
+ \chlewis{45,135}{O}
+ \quad
+ \chlewis{0o}{Na}
+\end{example}
+
+The next example shows the effect of some of the options:
+\begin{example}
+ \chlewis[lewis-default=.]{23,68,113,158,203,248,293,338}{X}
+ \quad
+ \chlewis{0,90,180,270}{X}
+ \quad
+ \chlewis[lewis-distance=1.25ex]{0,90,180,270}{X}
+ \quad
+ \chlewis[lewis-distance=.75ex,radical-radius=.5pt]{0,90,180,270}{X}
+ \quad
+ \chlewis[
+ radical-radius=.5pt,
+ lewis-default=.
+ ]{23,68,113,158,203,248,293,338}{X}
+\end{example}
+
+\begin{example}
+ \ch{
+ !($1s^22s^1$)( "\chlewis{180.}{Li}" ) +
+ !($1s^22s^22p^5$)( "\chlewis{0.90,180,270}{F}" )
+ ->
+ !($1s^2$)( Li+ ) + !($1s^22s^22p^6$)( "\chlewis{0,90,180,270}{F}" {}- )
+ }
+\end{example}
\section{Further Examples}
This section presents some examples of a possible usage.
-\begin{beispiel}
- \begin{reaction}[Synthese von Alkanen]
- !(Synthesegas)( $n$ CO + $(2n+1)$ H2 )
- ->[\SI{200}{\celsius}][\[CoNi\]]
- C_{$n$}H_{$2n+2$} + $n$ H2O
- \end{reaction}
-\end{beispiel}
-
-\begin{beispiel}
- \begin{reactions*}
- "a)" && CH4 + Cl2 &-> CH3Cl + HCl && "{\small Chlormethan/Methylchlorid}" \\
- "b)" && CH3Cl + Cl2 &-> CH2Cl2 + HCl && "{\small Dichlormethan/Methylenchlorid}" \\
- "c)" && CH2Cl2 + Cl2 &-> CHCl3 + HCl && "{\small Trichlormethan/Chloroform}" \\
- "d)" && CHCl3 + Cl2 &-> CCl4 + HCl && "{\small Tetrachlormethan/Tetrachlorkohlenstoff}"
- \end{reactions*}
-\end{beispiel}
-
-\begin{beispiel}
- \chemsetup[ox]{parse=false}
- \ch{"\ox{\delm,C}" -{} "\ox{\delp,M}" \qquad ( <-> "\ox{\delp,C}" -{} "\ox{\delm,Br}" )} \\
- \ch[adduct-space=0pt]{X. + .Y <=> X-Y + Bindungsenergie} \\
- \ch[name-format=\normalsize]{
- !(\State{H}{f}\qquad)() !(\textcolor{red}{??})( CH4\gas{} ) +
- !(\num{0})( 2 O2\gas{} )
- ->
- !(\num{-94.3})( CO2\gas{} ) +
- !(\num{-57.9})( H2O\lqd{} ) +
- !(\num{-192.1})( "\State{H}" )
- }
-\end{beispiel}
-
-\begin{beispiel}
- \newcommand\cstack[1]{%
- \clap{%
- \begin{tabular}{c}
- #1
- \end{tabular}
- }%
- }
- \begin{reactions*}
- CH3MgBr + "\ox*{1,Cu}" X &-> "\glqq" CH3 "\ox*{1,Cu}\grqq" + MgBrX "\qquad X~$=$~Br,I,CN" \\
- 2 MeLi + CuI &-> !(\cstack{Dimethylcuprat\\(Gilmann-Cuprat)})( Me2CuLi ) + Li
- \end{reactions*}
-\end{beispiel}
-
-\begin{beispiel}
- % needs `chemfig'
- \begin{reactions*}
- H3C-CH3 + Cl2 &->[$\Delta$][$h\nu$] H3CCH2Cl + HCl & &"\Enthalpy{-27.1}" \\
- H3C-CH3 + "\Lewis{0.,Cl}" &-> H3CCH2 "\Lewis{0.,\vphantom{H}}" + HCl & &"\Enthalpy{-5.0}" \\
- H3C-CH2 "\Lewis{0.,\vphantom{H}}" + Cl2 &-> H3CCH2Cl + "\Lewis{0.,Cl}" & &"\Enthalpy{-23.0}"
- \end{reactions*}
-\end{beispiel}
-
-The following example shows how the cancelling of compounds could be done%
-\footnote{Inspired by a question on TeX.SE: \url{http://tex.stackexchange.com/q/30118/5049}}.
-\begin{beispiel}
- % needs `cancel'
- \begin{align*}
- \ch{\cancel{HCOOH\aq} + H2O\lqd{} &<=> H3O^+\aq{} + \cancel{HCOO^-\aq}} \\
- \ch{\cancel{HCOO^-\aq} + H2O\lqd{} &<=> \cancel{HCOOH\aq} + OH^-\aq}\\[-1ex]
- \cline{1-2}
- \ch{H2O\lqd{} + H2O\lqd{} &<=> H3O^+\aq{} + OH^-\aq}
- \end{align*}
-\end{beispiel}
-
-\printbibliography
-
-{\catcode`\^=11 \catcode`\#=11
-\printindex}
+\begin{example}
+ \begin{reaction}[Synthese von Alkanen]
+ !(Synthesegas)( $n$ CO + $(2n+1)$ H2 )
+ ->[\SI{200}{\celsius}][\[CoNi\]]
+ C_{$n$}H_{$2n+2$} + $n$ H2O
+ \end{reaction}
+\end{example}
+
+\begin{example}
+ \begin{reactions*}
+ "a)" && CH4 + Cl2 &-> CH3Cl + HCl && "{\small Chlormethan/Methylchlorid}" \\
+ "b)" && CH3Cl + Cl2 &-> CH2Cl2 + HCl && "{\small Dichlormethan/Methylenchlorid}" \\
+ "c)" && CH2Cl2 + Cl2 &-> CHCl3 + HCl && "{\small Trichlormethan/Chloroform}" \\
+ "d)" && CHCl3 + Cl2 &-> CCl4 + HCl && "{\small Tetrachlormethan/Tetrachlorkohlenstoff}"
+ \end{reactions*}
+\end{example}
+
+\begin{example}
+ \chemsetup[ox]{parse=false}
+ \ch{
+ "\ox{\delm,C}" -{} "\ox{\delp,M}" \qquad
+ ( <-> "\ox{\delp,C}" -{} "\ox{\delm,Br}" )
+ } \\
+ \ch[adduct-space=0pt]{X. + .Y <=> X-Y + Bindungsenergie} \\
+ \ch[name-format=\normalsize]{
+ !(\State{H}{f}\qquad)() !(\textcolor{red}{??})( CH4\gas{} ) +
+ !(\num{0})( 2 O2\gas{} )
+ ->
+ !(\num{-94.3})( CO2\gas{} ) +
+ !(\num{-57.9})( H2O\lqd{} ) +
+ !(\num{-192.1})( "\State{H}" )
+ }
+\end{example}
+
+\begin{example}
+ \newcommand\cstack[1]{%
+ \clap{%
+ \begin{tabular}{c}
+ #1
+ \end{tabular}
+ }%
+ }
+ \begin{reactions*}
+ CH3MgBr + "\ox*{1,Cu}" X &
+ -> "\glqq" CH3 "\ox*{1,Cu}\grqq" + MgBrX "\qquad X~$=$~Br,I,CN" \\
+ 2 MeLi + CuI &
+ -> !(\cstack{Dimethylcuprat\\(Gilmann-Cuprat)})( Me2CuLi ) + Li
+ \end{reactions*}
+\end{example}
+
+\begin{example}
+ % needs `chemfig'
+ \begin{reactions*}
+ H3C-CH3 + Cl2 &
+ ->[$\Delta$][$h\nu$] H3CCH2Cl + HCl & &
+ "\Enthalpy{-27.1}" \\
+ H3C-CH3 + "\Lewis{0.,Cl}" &
+ -> H3CCH2 "\Lewis{0.,\vphantom{H}}" + HCl & &
+ "\Enthalpy{-5.0}" \\
+ H3C-CH2 "\Lewis{0.,\vphantom{H}}" + Cl2 &
+ -> H3CCH2Cl + "\Lewis{0.,Cl}" & &
+ "\Enthalpy{-23.0}"
+ \end{reactions*}
+\end{example}
+
+The following example shows how the cancelling of compounds could be
+done\footnote{Inspired by a question on TeX.SE:
+ \url{http://tex.stackexchange.com/q/30118/5049}}.
+\begin{example}
+ % needs `cancel'
+ \begin{align*}
+ \ch{\cancel{HCOOH\aq} + H2O\lqd{} &<=> H3O^+\aq{} + \cancel{HCOO^-\aq}} \\
+ \ch{\cancel{HCOO^-\aq} + H2O\lqd{} &<=> \cancel{HCOOH\aq} + OH^-\aq}\\[-1ex]
+ \cline{1-2}
+ \ch{H2O\lqd{} + H2O\lqd{} &<=> H3O^+\aq{} + OH^-\aq}
+ \end{align*}
+\end{example}
\end{document}
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemformula_test_sub_and_superscripts.tex b/Master/texmf-dist/doc/latex/chemmacros/chemformula_test_sub_and_superscripts.tex
index f08d1764bc0..9bb056af395 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemformula_test_sub_and_superscripts.tex
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemformula_test_sub_and_superscripts.tex
@@ -1,6 +1,10 @@
\documentclass[parskip=full]{scrartcl}
\usepackage{chemmacros}
+\chemsetup[chemformula]{
+ format=\color{blue}
+}
+
\newcommand*\cmd[2]{}
\begin{document}
@@ -188,4 +192,34 @@ $ A^{\ch{SO4^2-}}$
\ch{"->"}
-\end{document} \ No newline at end of file
+\bigskip
+
+\chlewis{0:90|180.270}{O}
+\quad
+\chlewis{45,135}{O}
+\quad
+\chlewis{0o}{Na}
+
+
+\chlewis[lewis-default=.]{23,68,113,158,203,248,293,338}{X}
+\quad
+\chlewis{0,90,180,270}{X}
+\quad
+\chlewis[lewis-distance=1.25ex]{0,90,180,270}{X}
+\quad
+\chlewis[lewis-distance=.75ex,radical-radius=.5pt]{0,90,180,270}{X}
+\quad
+\chlewis[
+ radical-radius=.5pt,
+ lewis-default=.
+]{23,68,113,158,203,248,293,338}{X}
+
+
+\ch{
+ !($1s^22s^1$)( "\chlewis{180.}{Li}" ) +
+ !($1s^22s^22p^5$)( "\chlewis{0.,90,180,270}{F}" )
+ ->
+ !($1s^2$)( Li+ ) + !($1s^22s^22p^6$)( "\chlewis{0,90,180,270}{F}" {}- )
+}
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.pdf
index 9aa4a941e6e..6292d2e775e 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.pdf
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.tex b/Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.tex
index 6132029a8f1..b0812580446 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.tex
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemgreek_en.tex
@@ -1,54 +1,128 @@
-% arara: xelatex
-% !arara: biber
-% !arara: xelatex
-% !arara: xelatex
-\documentclass[DIV11,toc=index,toc=bib]{cnpkgdoc}
-\docsetup{
- pkg = {[greek=newtx]chemmacros},
- language = en,
- title = the \Chemmacros\ bundle,
- subtitle = {
- packages \Chemmacros\ (v\csname chemmacros@version\endcsname),
- \Chemformula\ (v\csname chemformula@version\endcsname),
- \Ghsystem\ (v\csname ghsystem@version\endcsname) and
- \Chemgreek\ (v\csname chemgreek@version\endcsname)\\[2ex]
- {\Large documentation for the \Chemgreek\ package}},
- modules = true,
- code-box = {skipabove=1ex,skipbelow=1ex},
- label = {},
- name = chemgreek,
- version = \csname chemgreek@version\endcsname ,
- date = \csname chemgreek@date\endcsname ,
- url = https://bitbucket.org/cgnieder/chemmacros/
+% arara: pdflatex
+% arara: biber
+% arara: pdflatex
+% arara: pdflatex
+% --------------------------------------------------------------------------
+% the CHEMMACROS bundle
+% chemgreek_en.tex
+% macros and commands for chemists
+% --------------------------------------------------------------------------
+% Clemens Niederberger
+% --------------------------------------------------------------------------
+% https://bitbucket.org/cgnieder/chemmacros/
+% contact@mychemistry.eu
+% --------------------------------------------------------------------------
+% If you have any ideas, questions, suggestions or bugs to report, please
+% feel free to contact me.
+% --------------------------------------------------------------------------
+% Copyright 2011-2013 Clemens Niederberger
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Clemens Niederberger.
+% --------------------------------------------------------------------------
+\documentclass[load-preamble+]{cnltx-doc}
+\usepackage[greek=newtx]{chemmacros}
+\setcnltx{
+ package = {chemgreek},
+ title = \huge the \chemmacros\ bundle,
+ url = https://bitbucket.org/cgnieder/chemmacros/ ,
+ authors = Clemens Niederberger ,
+ email = contact@mychemistry.eu ,
+ info = {
+ packages \chemmacros\ (v\csname chemmacros@version\endcsname),
+ \chemformula\ (v\csname chemformula@version\endcsname),
+ \ghsystem\ (v\csname ghsystem@version\endcsname) and
+ \chemgreek\ (v\csname chemgreek@version\endcsname)\\[2ex]
+ {\Large documentation for the \chemgreek\ package}} ,
+ abstract = {%
+ \centering
+ \includegraphics{chemmacros-logo.pdf}
+ \par
+ } ,
+ add-cmds = {
+ abinitio, activatechemgreekmapping, AddRxnDesc, anti, aq, aqi,
+ ba, bond, bridge,
+ cd, ch, changechemgreeksymbol, charrow, chcpd, chemabove, Chemalpha,
+ Chembeta, Chemgamma, Chemdelta, ChemDelta, chemformula@bondlength,
+ Chemomega, Chemphi, ChemPhi, chemsetup, chlewis, chname , cip, cis, ch,
+ CNMR,
+ data, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias,
+ declarechemgreekmapping, DeclareChemIUPAC, DeclareChemLatin,
+ DeclareChemNMR, DeclareChemParticle, DeclareChemPhase,
+ DeclareChemReaction, DeclareChemState, delm, delp, Delta, Dfi,
+ el, ElPot, endo, Enthalpy, enthalpy, Entropy,
+ fmch, fpch, fscrm, fscrp,
+ gas, ghs, ghslistall, ghspic, Gibbs, gram,
+ hapto, HNMR, Helmholtz,
+ insitu, invacuo, iupac,
+ Ka, Kb, Kw,
+ Lfi, listofreactions, lqd, ltn,
+ mch, mega, meta, mhName,
+ newchemgreekmapping,
+ newman, NMR, Nu, Nuc,
+ orbital, ortho, ox, OX,
+ para, pch, per, pH, phase, photon, pKa, pKb, pOH, pos, positron,
+ Pot, prt,
+ Rad, redox, RenewChemArrow, RenewChemBond, renewchemgreekmapping,
+ RenewChemIUPAC, RenewChemLatin, RenewChemNMR, RenewChemParticle,
+ RenewChemPhase, RenewChemState,
+ Sf, scrm, scrp, second, selectchemgreekmapping, setchemformula,
+ ShowChemArrow, ShowChemBond, sld, Sod, State,
+ trans,
+ val
+ } ,
+ add-silent-cmds = {
+ addplot,
+ bottomrule,
+ cancel, cdot, ce, cee, celsius, centering, chemfig, chemname, clap,
+ cnsetup, color, cstack, cstsetup,
+ DeclareInstance, DeclareSIUnit, definecolor, draw,
+ electronvolt,
+ footnotesize,
+ glqq, grqq,
+ hertz, hspace,
+ includegraphics, intertext, IUPAC,
+ joule,
+ kilo,
+ latin, lewis, Lewis,
+ metre, midrule, milli, mmHg, mole,
+ nano, nicefrac, num, numrange,
+ ominus, oplus,
+ percent, pgfarrowsdeclarealias, pgfarrowsrenewalias,
+ renewtagform, rightarrow,
+ sample, scriptscriptstyle, setatomsep, setbondoffset, sfrac, shorthandoff,
+ si, SI, sisetup, square, subsection,
+ textcolor, textendash, textsuperscript, tiny, toprule,
+ upbeta, upeta, upgamma, usetikzlibrary,
+ volt, vphantom, vspave,
+ xspace
+ }
}
-\usepackage{chemfig,booktabs,cancel}
-\setlength\heavyrulewidth{1pt}
-\setlength\lightrulewidth{.4pt}
+\usepackage{chemfig,booktabs,cancel,varioref}
\usepackage[version=3]{mhchem}
-\usepackage{fontspec}
-\usepackage[oldstyle,proportional]{libertine}
-\usepackage[libertine]{newtxmath}
-\usepackage{libertinehologopatch}
-\setmonofont[Scale=MatchLowercase]{Bitstream Vera Sans Mono}
-\cnpkgusecolorscheme{friendly}
-\renewcommand*\othersectionlevelsformat[3]{%
- \textcolor{main}{#3\autodot}\enskip}
-\renewcommand*\partformat{%
- \textcolor{main}{\partname~\thepart\autodot}}
+\expandafter\def\csname libertine@figurestyle\endcsname{LF}
+\usepackage[libertine]{newtxmath}
+\expandafter\def\csname libertine@figurestyle\endcsname{OsF}
-\usepackage{fnpct}
\usepackage[biblatex]{embrac}
\ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
-\pagestyle{headings}
-
\usepackage[accsupp]{acro}
\acsetup{
- long-format=\scshape,
- short-format=\scshape
+ long-format = \scshape ,
+ short-format = \scshape
}
\DeclareAcronym{ghs}{
short = ghs ,
@@ -58,7 +132,7 @@
accsupp = GHS
}
\DeclareAcronym{eu}{
- short = eu ,
+ short = EU ,
long = European Union ,
pdfstring = EU ,
accsupp = EU
@@ -90,71 +164,59 @@
\chemsetup{
option/synchronize ,
- chemformula/font-spec={[Numbers=Lining]Linux Libertine O}
+ chemformula/format = \libertineLF
}
-\colorlet{chemformula}{darkgray}
+% \colorlet{chemformula}{black!90}
\sisetup{
detect-mode=false,
mode=text,
- text-rm=\addfontfeatures{Numbers={Proportional,Lining}}
+ text-rm=\libertineLF
}
\usepackage{filecontents}
-\begin{filecontents*}{\jobname.ist}
- preamble "\\begin{theindex}\n Section titles are indicated \\textbf{bold},
- packages \\textsf{sans serif}, commands \\code{\\textbackslash\\textcolor{code}{brown}},
- options \\textcolor{key}{\\code{yellow}} and modules (only \\chemmacros)
- \\textcolor{module}{\\code{blue}}.\\newline\n\n"
- heading_prefix "{\\bfseries "
- heading_suffix "\\hfil}\\nopagebreak\n"
- headings_flag 1
- delim_0 "\\dotfill\\hyperpage{"
- delim_1 "\\dotfill\\hyperpage{"
- delim_2 "\\dotfill\\hyperpage{"
- delim_r "}\\textendash\\hyperpage{"
- delim_t "}"
- suffix_2p "\\nohyperpage{\\,f.}"
- suffix_3p "\\nohyperpage{\\,ff.}"
-\end{filecontents*}
-
-\usepackage[backend=biber,style=alphabetic,maxbibnames=20]{biblatex}
\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ürgen Stohner and Herbert L. Strauss and
- Michio Takami and Anders J Thor},
- title = {“Quantities, Symbols and Units in Physical Chemistry”, \acs{iupac}
- Green Book},
- edition = {3rd Edition. 2nd Printing},
- year = {2008},
+ Bertil Holmstr\"om and Kozo Kuchitsu and Roberto Marquardt and Ian Mills and
+ Franco Pavese and Martin Quack and J\"urgen Stohner and Herbert L. Strauss and
+ Michio Takami and Anders J Thor} ,
+ title = {``Quantities, Symbols and Units in Physical Chemistry'', \acs{iupac}
+ Green Book} ,
+ sorttitle = {Quantities, Symbols and Units in Physical Chemistry} ,
+ indexsorttitle = {Quantities, Symbols and Units in Physical Chemistry} ,
+ edition = {3rd Edition. 2nd Printing} ,
+ year = {2008} ,
publisher = {\acs{iupac} \&\ RSC Publishing, Cambridge}
}
@book{iupac:redbook,
author = {Neil G. Connelly and Ture Damhus and Richard M. Hartshorn and
- Alan T. Hutton},
- title = {“Nomenclature of Inorganic Chemistry”, \acs{iupac} Red Book},
- year = {2005},
- publisher = { \acs{iupac} \&\ RSC Publishing, Cambridge},
+ Alan T. Hutton} ,
+ title = {``Nomenclature of Inorganic Chemistry'', \acs{iupac} Red Book} ,
+ sorttitle = {Nomenclature of Inorganic Chemistry} ,
+ indexsorttitle = {Nomenclature of Inorganic Chemistry} ,
+ year = {2005} ,
+ publisher = { \acs{iupac} \&\ RSC Publishing, Cambridge} ,
isbn = {0-85404-438-8}
}
@misc{eu:ghsystem_regulation,
author = {{The European Parliament and The Council of the European Union}},
- title = {Regulation (EC) No 1272/2008 of the European Parliament and of the Council},
- subtitle = {on classification, labelling and packaging of substances and mixtures,
- amending and repealing Directives 67/548/EEC and 1999/45/EC, and amending
- Regulation (EC) No 1907/2006},
- journal = {Official Journal of the European Union},
+ title = {Regulation (EC) No 1272/2008 of the European Parliament and of
+ the Council} ,
+ subtitle = {on classification, labelling and packaging of substances and
+ mixtures, amending and repealing Directives 67/548/EEC and 1999/45/EC, and
+ amending Regulation (EC) No 1907/2006} ,
+ journal = {Official Journal of the European Union} ,
date = {2008-12-16}
}
@online{unece:ghsystem_implementation,
- author = {United Nations Economic Commission for Europe},
- title = {GHS Implementation},
- url = {http://www.unece.org/trans/danger/publi/ghs/implementation_e.html},
- urldate = {2012-03-20},
+ author = {United Nations Economic Commission for Europe} ,
+ title = {GHS Implementation} ,
+ url =
+ {http://www.unece.org/trans/danger/publi/ghs/implementation_e.html} ,
+ urldate = {2012-03-20} ,
date = {2012-03-20}
}
\end{filecontents*}
@@ -172,126 +234,25 @@
\usetikzlibrary{calc,positioning,decorations.pathmorphing,patterns}
-\pgfdeclaredecoration{penciline}{initial}{
- \state{initial}[
- width=+\pgfdecoratedinputsegmentremainingdistance,
- auto corner on length=1mm
- ]{
- \pgfpathcurveto%
- {% From
- \pgfqpoint
- {\pgfdecoratedinputsegmentremainingdistance}
- {\pgfdecorationsegmentamplitude}
- }
- {% Control 1
- \pgfmathrand
- \pgfpointadd
- {\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- {%
- \pgfqpoint
- {-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}%
- {\pgfmathresult\pgfdecorationsegmentamplitude}
- }
- }
- {%TO
- \pgfpointadd
- {\pgfpointdecoratedinputsegmentlast}
- {\pgfpoint{1pt}{1pt}}
- }
- }
- \state{final}{}
-}
-\tikzset{pencil/.style={decorate,decoration=penciline}}
-
-\TitlePicture{%
- \ch[font-spec={Augie}]{
- 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
- ->
- 2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
- }
- \redox(o1,o2)[red,pencil,-cf]{\small\ch[font-spec={[Color=red]Augie},math-space=.3em]{$-$ 2 e-}}
- \redox(r1,r2)[blue,pencil,-cf][-1]{\small\ch[font-spec={[Color=blue]Augie},math-space=.3em]{$+$ 2 e-}}}
-
-\addcmds{
- a, abinitio, AddRxnDesc, anti, aq, aqi,
- b, ba, bond, bottomrule, bridge,
- cancel, cd, cdot, ce, cee, celsius, centering, changechemgreeksymbol,
- chemabove, Chemalpha, Chembeta, Chemgamma, ChemGamma, Chemdelta,
- ChemDelta, chemfig, chemname, Chemomega, Chemphi, ChemPhi, chemsetup, cip,
- cis, ch, clap, cnsetup, CNMR, color, cstack,
- cstsetup,
- d, D, data, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias,
- DeclareChemIUPAC, DeclareChemLatin, DeclareChemNMR, DeclareChemParticle,
- DeclareChemPhase, DeclareChemReaction, DeclareChemState, DeclareInstance,
- DeclareSIUnit, definecolor, delm, delp, Delta, Dfi, draw,
- E, el, electronvolt, ElPot, endo, Enthalpy, enthalpy, Entropy,
- footnotesize, fmch, fpch, fscrm, fscrp,
- g, gas, ghs, ghslistall, ghspic, Gibbs, glqq, gram, grqq,
- H, hapto, HNMR, Helmholtz, hertz, hspace,
- includegraphics, insitu, intertext, invacuo, iupac, IUPAC,
- J, joule,
- Ka, Kb, kilo, Kw,
- L, latin, lewis, Lewis, Lfi, listofreactions, lqd, ltn,
- mch, mega, meta, metre, mhName, midrule, milli, mmHg, mole,
- N, nano, nicefrac, newchemgreekmapping, newman, NMR, Nu, Nuc, num, numrange,
- O, ominus, orbital, ortho, oplus, ox, OX,
- p, P, para, pch, per, percent, pgfarrowsdeclarealias, pgfarrowsrenewalias,
- pH, phase, phi, Phi, photon, pKa, pKb, pOH, pos, positron, Pot, prt,
- R, Rad, redox, RenewChemArrow, RenewChemBond, RenewChemIUPAC,
- RenewChemLatin, RenewChemNMR, RenewChemParticle, RenewChemPhase,
- RenewChemState, renewtagform, rightarrow,
- S, Sf, sample, scriptscriptstyle, scrm, scrp, second,
- selectchemgreekmapping, setatomsep, setbondoffset, setchemformula, sfrac,
- shorthandoff, ShowChemArrow, ShowChemBond, si, SI, sisetup, sld, Sod,
- square, State, subsection,
- textcolor, textendash, textsuperscript, tiny, toprule, trans,
- upbeta, upeta, upgamma, upphi, upPhi, Upphi,
- val, volt, vphantom, vspave,
- w, xspace, Z
-}
+\newpackagename\chemmacros{chemmacros}
+\newpackagename\chemformula{chemformula}
+\newpackagename\ghsystem{ghsystem}
+% \newpackagename\chemgreek{chemgreek}
-\usepackage{imakeidx}
-\indexsetup{othercode=\footnotesize}
-\makeindex[columns=3,intoc,options={-sl \jobname.ist}]
-\newcommand*\Chemmacros{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemmacros%
- }%
-}
-\providecommand*\chemmacros{{\scshape\textcolor{main}{chemmacros}}\xspace}
+\newidxcmd\manual{\textsf{#1}}[\ (manual)]
-\newcommand*\Chemformula{%
+\newenvironment{codedesc}
{%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemformula%
- }%
-}
-\providecommand*\chemformula{{\scshape\textcolor{main}{chemformula}}\xspace}
-
-\newcommand*\Ghsystem{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- ghsystem%
- }%
-}
-\providecommand*\ghsystem{{\scshape\textcolor{main}{ghsystem}}\xspace}
-
-\newcommand*\Chemgreek{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemgreek%
- }%
-}
-\providecommand*\chemgreek{{\scshape\textcolor{main}{chemgreek}}\xspace}
+ \def\Code##1{\item\code{##1}\hfill\newline}%
+ \cnltxlist
+ }
+ {\endcnltxlist}
\renewcommand*\AmS{\hologo{AmS}}
+\newcommand*\TikZ{Ti\textit{k}Z}
+
\newcommand*\tablehead[1]{\textrm{\bfseries#1}}
\begin{document}
@@ -301,10 +262,10 @@ The \chemgreek\ package is an auxiliary package for other chemistry packages
such as \chemmacros. In chemistry there is often the need for upright greek
letters. The \chemgreek\ package provides an interface to various other
packages that provide upright greek letters. One could mention
-\paket{textgreek}, \paket{upgreek}, \paket[fonts]{newtx} or
-\paket[fonts]{kpfonts}. All of these packages provide upright greek letters,
-some a whole alphabet some only the upright variants of the standard italic
-symbols for which macros are defined in base \LaTeX.
+\pkg{textgreek}, \pkg{upgreek}, \pkg{newtx} or \pkg{kpfonts}. All of these
+packages provide upright greek letters, some a whole alphabet some only the
+upright variants of the standard italic symbols for which macros are defined
+in base \LaTeX.
\chemgreek\ offers a possibility to map those different interfaces to a
unified set of macros for usage in a chemistry package. This is useful as
@@ -314,70 +275,67 @@ is not limited to a certain package or font. Consequently this package is
used by \chemmacros\ and its \acs{iupac} naming commands.
\section{Licence and Requirements}
-Permission is granted to copy, distribute and/or modify this software under
-the terms of the \LaTeX\ project public license (lppl) version 1.3 or later
-(\url{http://www.latex-project.org/lppl.txt}). The package has the status
-``maintained.''
+\license
\chemgreek\ loads the following packages:
-\paket*{expl3}\footnote{\CTANurl{l3kernel}} and
-\paket*{xparse}\footnote{\CTANurl{l3packages}}.
+\pkg{expl3}\footnote{\CTANurl{l3kernel}}~\cite{bnd:l3kernel} and
+\pkg{xparse}\footnote{\CTANurl{l3packages}}~\cite{bnd:l3packages}.
\section{Define Mappings}
\selectchemgreekmapping{default}
\chemgreek's main commands are:
-\begin{beschreibung}
- \Befehl{newchemgreekmapping}{<name>}\ma{<mapping list>}\newline
+\begin{commands}
+ \command{newchemgreekmapping}[\marg{name}\marg{mapping list}]
Add a new mapping to \chemgreek. Issue an error if it already exists.
- \Befehl{renewchemgreekmapping}{<name>}\ma{<mapping list>}\newline
+ \command{renewchemgreekmapping}[\marg{name}\marg{mapping list}]
Renew a \chemgreek\ mapping. Issue an error if it doesn't exist yet.
- \Befehl{declarechemgreekmapping}{<name>}\ma{<mapping list>}\newline
+ \command{declarechemgreekmapping}[\marg{name}\marg{mapping list}]
Declare a new mapping to \chemgreek. If the mapping already exists it
will be overwritten.
-\end{beschreibung}
+\end{commands}
-The command \cmd{newchemgreekmapping} needs to get a comma separated list of
+The command \cs{newchemgreekmapping} needs to get a comma separated list of
24 pairs divided by a slash. The first entry is the lowercase version und the
second the uppercase version for the corresponding greek letter at the current
position. This will become clearer if you look at how the \code{default}
mapping is defined:
-\begin{beispiel}[code only]
-\newchemgreekmapping{default}
- {
- \ensuremath{\alpha} / \ensuremath{\mathrm{A}} , % 1: alpha
- \ensuremath{\beta} / \ensuremath{\mathrm{B}} , % 2: beta
- \ensuremath{\gamma} / \ensuremath{\Gamma} , % 3: gamma
- \ensuremath{\delta} / \ensuremath{\Delta} , % 4: delta
- \ensuremath{\epsilon} / \ensuremath{\mathrm{E}} , % 5: epsilon
- \ensuremath{\zeta} / \ensuremath{\mathrm{Z}} , % 6: zeta
- \ensuremath{\eta} / \ensuremath{\mathrm{H}} , % 7: eta
- \ensuremath{\theta} / \ensuremath{\Theta} , % 8: theta
- \ensuremath{\iota} / \ensuremath{\mathrm{I}} , % 9: iota
- \ensuremath{\kappa} / \ensuremath{\mathrm{K}} , % 10: kappa
- \ensuremath{\lambda} / \ensuremath{\Lambda} , % 11: lambda
- \ensuremath{\mu} / \ensuremath{\mathrm{M}} , % 12: mu
- \ensuremath{\nu} / \ensuremath{\mathrm{N}} , % 13: nu
- \ensuremath{\xi} / \ensuremath{\Xi} , % 14: xi
- \ensuremath{o} / \ensuremath{\mathrm{O}} , % 15: omikron
- \ensuremath{\pi} / \ensuremath{\Pi} , % 16: pi
- \ensuremath{\rho} / \ensuremath{\mathrm{P}} , % 17: rho
- \ensuremath{\sigma} / \ensuremath{\Sigma} , % 18: sigma
- \ensuremath{\tau} / \ensuremath{\mathrm{T}} , % 19: tau
- \ensuremath{\upsilon} / \ensuremath{\Upsilon} , % 20: upsilon
- \ensuremath{\phi} / \ensuremath{\Phi} , % 21: phi
- \ensuremath{\psi} / \ensuremath{\Psi} , % 22: psi
- \ensuremath{\chi} / \ensuremath{\mathrm{X}} , % 23: chi
- \ensuremath{\omega} / \ensuremath{\Omega} % 24: omega
+\begin{sourcecode}
+ \newchemgreekmapping{default}
+ {
+ \ensuremath{\alpha} / \ensuremath{\mathrm{A}} , % 1: alpha
+ \ensuremath{\beta} / \ensuremath{\mathrm{B}} , % 2: beta
+ \ensuremath{\gamma} / \ensuremath{\Gamma} , % 3: gamma
+ \ensuremath{\delta} / \ensuremath{\Delta} , % 4: delta
+ \ensuremath{\epsilon} / \ensuremath{\mathrm{E}} , % 5: epsilon
+ \ensuremath{\zeta} / \ensuremath{\mathrm{Z}} , % 6: zeta
+ \ensuremath{\eta} / \ensuremath{\mathrm{H}} , % 7: eta
+ \ensuremath{\theta} / \ensuremath{\Theta} , % 8: theta
+ \ensuremath{\iota} / \ensuremath{\mathrm{I}} , % 9: iota
+ \ensuremath{\kappa} / \ensuremath{\mathrm{K}} , % 10: kappa
+ \ensuremath{\lambda} / \ensuremath{\Lambda} , % 11: lambda
+ \ensuremath{\mu} / \ensuremath{\mathrm{M}} , % 12: mu
+ \ensuremath{\nu} / \ensuremath{\mathrm{N}} , % 13: nu
+ \ensuremath{\xi} / \ensuremath{\Xi} , % 14: xi
+ \ensuremath{o} / \ensuremath{\mathrm{O}} , % 15: omikron
+ \ensuremath{\pi} / \ensuremath{\Pi} , % 16: pi
+ \ensuremath{\rho} / \ensuremath{\mathrm{P}} , % 17: rho
+ \ensuremath{\sigma} / \ensuremath{\Sigma} , % 18: sigma
+ \ensuremath{\tau} / \ensuremath{\mathrm{T}} , % 19: tau
+ \ensuremath{\upsilon} / \ensuremath{\Upsilon} , % 20: upsilon
+ \ensuremath{\phi} / \ensuremath{\Phi} , % 21: phi
+ \ensuremath{\psi} / \ensuremath{\Psi} , % 22: psi
+ \ensuremath{\chi} / \ensuremath{\mathrm{X}} , % 23: chi
+ \ensuremath{\omega} / \ensuremath{\Omega} % 24: omega
}
-\end{beispiel}
+\end{sourcecode}
-There \emph{must} be 24 pairs of entries, i.e., a complete mapping! Those
+There \emph{must} be 24 pairs of entries, \ie, a complete mapping! Those
entries are the ones that will be used by the interface macros. For each
-letter a pair \cmd{Chemalpha}/\cmd{ChemAlpha} is defined that uses the entries
+letter a pair \cs{Chemalpha}/\cs{ChemAlpha} is defined that uses the entries
of the currently active mapping. That means there are 48 (robust) macros
-defined each beginning with \cmd*{Chem...} followed by the lowercase or
+defined each beginning with \cs*{Chem...} followed by the lowercase or
uppercase name of the Greek letter.
The default mapping is -- as you can probably see -- \emph{not an upright
@@ -386,9 +344,9 @@ package but let's the user (or another package) choose. The \chemmacros\
package for example provides a package option that selects one of the
available mappings.
-\begin{beispiel}
+\begin{example}
Default mapping: \Chemphi\ and \ChemPhi, $\phi$ and $\Phi$
-\end{beispiel}
+\end{example}
\section{Predefined Mappings and Selection of a Mapping}
\chemgreek\ predefines some mappings. Some of the mappings require additional
@@ -403,12 +361,12 @@ in table~\ref{tab:mappings}.
\midrule
default & --- \\
var-default & --- \\
- textgreek & \paket*{textgreek} \\
- upgreek & \paket*{upgreek} \\
- newtx & \paket*{newtxmath} \\
- kpfonts & \paket*{kpfonts} \\
- mathdesign & \paket*{mathdesign} \\
- fourier & \paket*{fourier} \\
+ textgreek & \pkg{textgreek} \cite{pkg:textgreek} \\
+ upgreek & \pkg{upgreek} \cite{pkg:upgreek} \\
+ newtx & \pkg{newtxmath} \cite{pkg:newtx} \\
+ kpfonts & \pkg{kpfonts} \cite{pkg:kpfonts} \\
+ mathdesign & \pkg{mathdesign} \cite{pkg:mathdesign} \\
+ fourier & \pkg{fourier} \cite{pkg:fourier} \\
\bottomrule
\end{tabular}
\caption{Predefined mappings.}
@@ -416,63 +374,59 @@ in table~\ref{tab:mappings}.
\end{table}
A mapping is selected and activated with one of the following commands:
-\begin{beschreibung}
- \Befehl{activatechemgreekmapping}*[<options>]{<name>}\newline
- This commands selects and activates the mapping \code{<name>}. If the
- star variant is used also the package \code{<name>} is loaded with options
- \code{<options>}. This obviously only makes sense if the package name is
- the same as the mapping name. The command can only be used in the
- document preamble.
- \Befehl{selectchemgreekmapping}{<name>}
- This commands selects and activates the mapping \code{<name>}. A required
- package has to be loaded additionally the usual way via \cmd*{usepackage}
- or \cmd*{RequirePackage}. The command can be used throughout the
- document.
-\end{beschreibung}
-
-\begin{beispiel}
+\begin{commands}
+ \command{activatechemgreekmapping}[\sarg\oarg{options}\marg{name}]
+ This commands selects and activates the mapping \meta{name}. If the star
+ variant is used also the package \meta{name} is loaded with options
+ \meta{options}. This obviously only makes sense if the package name is the
+ same as the mapping name. The command can only be used in the document
+ preamble.
+ \command{selectchemgreekmapping}[\marg{name}]
+ This commands selects and activates the mapping \meta{name}. A required
+ package has to be loaded additionally the usual way via \cs*{usepackage}
+ or \cs*{RequirePackage}. The command can be used throughout the document.
+\end{commands}
+
+\begin{example}
% requires the `newtxmath' package to be loaded:
\Chemphi\ and \ChemPhi, $\phi$ and $\Phi$\par
\selectchemgreekmapping{newtx}
\Chemphi\ and \ChemPhi, $\upphi$ and $\upPhi$
-\end{beispiel}
+\end{example}
\section{Changing a Specific Symbol in an Existing Mapping}
If you should want to change a specifig entry of a specific mapping it would
be rather tedious to redefine the whole mapping. That is why \chemgreek\
provides a command for that purpose:
-\begin{beschreibung}
- \Befehl{changechemgreeksymbol}{<mapping name>}\ma{upper|lower}\ma{<entry
- name>}\ma{<entry>}\newline
- Changes the \code{upper}- or \code{lower}case entry \code{<entry name>} in
- the mapping \code{<mapping name>}.
-\end{beschreibung}
+\begin{commands}
+ \command{changechemgreeksymbol}[\marg{mapping
+ name}\Marg{upper|lower}\marg{entry name}\marg{entry}]
+ Changes the \code{upper}- or \code{lower}case entry \meta{entry name} in
+ the mapping \meta{mapping name}.
+\end{commands}
In order to activate the change you need the (re-) activate the affected
mapping afterwards:
-\begin{beispiel}
+\begin{example}
\changechemgreeksymbol{default}{lower}{alpha}{xxx}
\selectchemgreekmapping{default}
\Chemalpha
-\end{beispiel}
+\end{example}
\section{Inspecting a Mapping}
-If you want to check if a mapping has been correctly set you can use
-\begin{beschreibung}
- \Befehl{showchemgreekmapping}{<mapping>}
-\end{beschreibung}
-which will typeset a table (using a simple \code{tabular} environment) with
-all 48 characters like the one shown in table~\ref{tab:showmapping}.
+If you want to check if a mapping has been correctly set you can use the
+following command:
+\begin{commands}
+ \command{showchemgreekmapping}[\marg{mapping}]
+ This will typeset a table (using a simple \code{tabular} environment) with
+ all 48 characters like the one shown in table~\ref{tab:showmapping}.
+\end{commands}
\begin{table}[htbp]
\centering
\showchemgreekmapping{newtx}
- \caption{A demonstration of the \cmd*{showchemgreekmapping} command.}
+ \caption{A demonstration of the \cs*{showchemgreekmapping} command.}
\label{tab:showmapping}
\end{table}
-\appendix
-
-\printindex
-
\end{document}
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf
index e2d05df574d..f21d010f854 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex
index ae8c16ccbc9..bf87b1a3597 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex
@@ -1,88 +1,129 @@
-% arara: xelatex
+% !arara: pdflatex
% !arara: biber
-% arara: xelatex
-% arara: xelatex
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% -----------------------------------------------------------------------------
-% - the CHEMMACROS bundle
-% - chemmacros_en.tex
-% - macros and commands for chemists
-% -----------------------------------------------------------------------------
-% - Clemens Niederberger
-% -
-% -----------------------------------------------------------------------------
-% - https://bitbucket.org/cgnieder/chemmacros/
-% - contact@mychemistry.eu
-% -----------------------------------------------------------------------------
-% - If you have any ideas, questions, suggestions or bugs to report, please
-% - feel free to contact me.
-% -----------------------------------------------------------------------------
-% - Copyright 2011-2013 Clemens Niederberger
-% -
-% - This work may be distributed and/or modified under the
-% - conditions of the LaTeX Project Public License, either version 1.3
-% - of this license or (at your option) any later version.
-% - The latest version of this license is in
-% - http://www.latex-project.org/lppl.txt
-% - and version 1.3 or later is part of all distributions of LaTeX
-% - version 2005/12/01 or later.
-% -
-% - This work has the LPPL maintenance status `maintained'.
-% -
-% - The Current Maintainer of this work is Clemens Niederberger.
-% -----------------------------------------------------------------------------
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% arara: pdflatex
+% arara: pdflatex
+% --------------------------------------------------------------------------
+% the CHEMMACROS bundle
+% chemmacros_en.tex
+% macros and commands for chemists
+% --------------------------------------------------------------------------
+% Clemens Niederberger
+% --------------------------------------------------------------------------
+% https://bitbucket.org/cgnieder/chemmacros/
+% contact@mychemistry.eu
+% --------------------------------------------------------------------------
+% If you have any ideas, questions, suggestions or bugs to report, please
+% feel free to contact me.
+% --------------------------------------------------------------------------
+% Copyright 2011-2013 Clemens Niederberger
%
-% if you want to compile this documentation
-% a) you'll need the document class `cnpkgdoc' which you can get here:
-% https://bitbucket.org/cgnieder/cnpkgdoc/
-% the class is licensed LPPL 1.3 or later
-% b) you need the following compilation order:
-% > xelatex chemmacros_en (2 or probably 3 times)
-% > biber chemmacros_en
-% > xelatex chemmacros_en (2 times)
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
%
-\documentclass[DIV11,toc=index,toc=bib]{cnpkgdoc}
-\docsetup{
- pkg = {[greek=newtx]chemmacros},
- language = en,
- title = the \Chemmacros\ bundle,
- subtitle = {
- packages \Chemmacros\ (v\csname chemmacros@version\endcsname),
- \Chemformula\ (v\csname chemformula@version\endcsname),
- \Ghsystem\ (v\csname ghsystem@version\endcsname) and
- \Chemgreek\ (v\csname chemgreek@version\endcsname)\\[2ex]
- {\Large documentation for the \Chemmacros\ package}},
- modules = true,
- code-box = {skipabove=1ex,skipbelow=1ex},
- label = {},
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Clemens Niederberger.
+% --------------------------------------------------------------------------
+\documentclass[load-preamble+]{cnltx-doc}
+\usepackage[greek=newtx]{chemmacros}
+\setcnltx{
+ package = {chemmacros},
+ title = \huge the \chemmacros\ bundle,
+ url = https://bitbucket.org/cgnieder/chemmacros/ ,
+ authors = Clemens Niederberger ,
+ email = contact@mychemistry.eu ,
+ info = {
+ packages \chemmacros\ (v\csname chemmacros@version\endcsname),
+ \chemformula\ (v\csname chemformula@version\endcsname),
+ \ghsystem\ (v\csname ghsystem@version\endcsname) and
+ \chemgreek\ (v\csname chemgreek@version\endcsname)\\[2ex]
+ {\Large documentation for the \chemmacros\ package}} ,
+ abstract = {%
+ \centering
+ \includegraphics{chemmacros-logo.pdf}
+ \par
+ } ,
+ add-cmds = {
+ abinitio, activatechemgreekmapping, AddRxnDesc, anti, aq, aqi,
+ ba, bond, bridge,
+ cd, ch, changechemgreeksymbol, charrow, chcpd, chemabove, Chemalpha,
+ Chembeta, Chemgamma, Chemdelta, ChemDelta, chemformula@bondlength,
+ Chemomega, Chemphi, ChemPhi, chemsetup, chlewis, chname , cip, cis, ch,
+ CNMR,
+ data, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias,
+ declarechemgreekmapping, DeclareChemIUPAC, DeclareChemLatin,
+ DeclareChemNMR, DeclareChemParticle, DeclareChemPhase,
+ DeclareChemReaction, DeclareChemState, delm, delp, Delta, Dfi,
+ el, ElPot, endo, Enthalpy, enthalpy, Entropy,
+ fmch, fpch, fscrm, fscrp,
+ gas, ghs, ghslistall, ghspic, Gibbs, gram,
+ hapto, HNMR, Helmholtz,
+ insitu, invacuo, iupac,
+ Ka, Kb, Kw,
+ Lfi, listofreactions, lqd,
+ mch, mega, meta, mhName,
+ newchemgreekmapping,
+ newman, NMR, Nu, Nuc,
+ orbital, ortho, ox, OX,
+ para, pch, per, pH, phase, photon, pKa, pKb, pOH, pos, positron,
+ Pot, prt,
+ Rad, redox, RenewChemArrow, RenewChemBond, renewchemgreekmapping,
+ RenewChemIUPAC, RenewChemLatin, RenewChemNMR, RenewChemParticle,
+ RenewChemPhase, RenewChemState,
+ Sf, scrm, scrp, second, selectchemgreekmapping, setchemformula,
+ ShowChemArrow, ShowChemBond, sld, Sod, State,
+ trans,
+ val
+ } ,
+ add-silent-cmds = {
+ addplot,
+ bottomrule,
+ cancel, cdot, ce, cee, celsius, centering, chemfig, chemname, clap,
+ cnsetup, color, cstack, cstsetup,
+ DeclareInstance, DeclareSIUnit, definecolor, draw,
+ electronvolt,
+ footnotesize,
+ glqq, grqq,
+ hertz, hspace,
+ includegraphics, intertext, IUPAC,
+ joule,
+ kilo,
+ latin, lewis, Lewis, liquid, ltn,
+ metre, midrule, milli, mmHg, mole,
+ nano, nicefrac, num, numrange,
+ ominus, oplus,
+ percent, pgfarrowsdeclarealias, pgfarrowsrenewalias,
+ renewtagform, rightarrow,
+ sample, scriptscriptstyle, setatomsep, setbondoffset, sfrac, shorthandoff,
+ si, SI, sisetup, square, subsection,
+ textcolor, textendash, textsuperscript, tiny, toprule,
+ upbeta, upeta, upgamma, usetikzlibrary,
+ volt, vphantom, vspave,
+ xspace,
+ z@, z@skip
+ }
}
-\usepackage{chemfig,booktabs,cancel}
+\usepackage{chemfig,booktabs,cancel,varioref,csquotes}
\usepackage[version=3]{mhchem}
-\usepackage{fontspec}
-\usepackage[oldstyle,proportional]{libertine}
-\usepackage[libertine]{newtxmath}
-\usepackage{libertinehologopatch}
-\setmonofont[Scale=MatchLowercase]{Bitstream Vera Sans Mono}
-\cnpkgusecolorscheme{friendly}
-\renewcommand*\othersectionlevelsformat[3]{%
- \textcolor{main}{#3\autodot}\enskip}
-\renewcommand*\partformat{%
- \textcolor{main}{\partname~\thepart\autodot}}
+\expandafter\def\csname libertine@figurestyle\endcsname{LF}
+\usepackage[libertine]{newtxmath}
+\expandafter\def\csname libertine@figurestyle\endcsname{OsF}
-\usepackage{fnpct}
\usepackage[biblatex]{embrac}
\ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
-\pagestyle{headings}
-
\usepackage[accsupp]{acro}
\acsetup{
- long-format=\scshape,
- short-format=\scshape
+ long-format = \scshape ,
+ short-format = \scshape
}
\DeclareAcronym{ghs}{
short = ghs ,
@@ -97,12 +138,6 @@
pdfstring = EU ,
accsupp = EU
}
-\DeclareAcronym{id}{
- short = id ,
- long = identification string ,
- pdfstring = ID ,
- accsupp = ID
-}
\DeclareAcronym{iupac}{
short = iupac ,
long = International Union of Pure and Applied Chemistry ,
@@ -119,7 +154,7 @@
short = dvi ,
long = device independent file format ,
pdfstring = DVI ,
- accsupp = DVI
+ accsupp = DVO
}
\DeclareAcronym{pdf}{
short = pdf ,
@@ -127,84 +162,78 @@
pdfstring = PDF ,
accsupp = PDF
}
+\DeclareAcronym{id}{
+ short = id ,
+ long = identification string ,
+ pdfstring = ID ,
+ accsupp = ID
+}
\chemsetup{
option/synchronize ,
- chemformula/font-spec={[Numbers=Lining]Linux Libertine O}
+ chemformula/format = \libertineLF
}
-\colorlet{chemformula}{darkgray}
+% \colorlet{chemformula}{black!90}
\sisetup{
detect-mode=false,
mode=text,
- text-rm=\addfontfeatures{Numbers={Proportional,Lining}}
+ text-rm=\libertineLF
}
\usepackage{filecontents}
-\begin{filecontents*}{\jobname.ist}
- preamble "\\begin{theindex}\n Section titles are indicated \\textbf{bold},
- packages \\textsf{sans serif}, commands \\code{\\textbackslash\\textcolor{code}{brown}},
- options \\textcolor{key}{\\code{yellow}} and modules (only \\chemmacros)
- \\textcolor{module}{\\code{blue}}.\\newline\n\n"
- heading_prefix "{\\bfseries "
- heading_suffix "\\hfil}\\nopagebreak\n"
- headings_flag 1
- delim_0 "\\dotfill\\hyperpage{"
- delim_1 "\\dotfill\\hyperpage{"
- delim_2 "\\dotfill\\hyperpage{"
- delim_r "}\\textendash\\hyperpage{"
- delim_t "}"
- suffix_2p "\\nohyperpage{\\,f.}"
- suffix_3p "\\nohyperpage{\\,ff.}"
-\end{filecontents*}
-
-\usepackage[backend=biber,style=alphabetic,maxbibnames=20]{biblatex}
\addbibresource{\jobname.bib}
\begin{filecontents*}{\jobname.bib}
-@book{iupac:bluebook,
- author = {R. Panico and W. H. Powell and J-C. Richer},
- title = {“Nomenclature of Organic Chemistry, Sections A, B, C, D, E, F, and H”, \acs{iupac}
- Blue Book},
- edition = {\mkbibacro{DRAFT}},
- date = {2004-10-07},
- url =
- {http://old.iupac.org/reports/provisional/abstract04/BB-prs310305/CompleteDraft.pdf},
- urldate = {2013-07-07}
-}
@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ürgen Stohner and Herbert L. Strauss and
- Michio Takami and Anders J Thor},
- title = {“Quantities, Symbols and Units in Physical Chemistry”, \acs{iupac}
- Green Book},
- edition = {3rd Edition. 2nd Printing},
- year = {2008},
+ Bertil Holmstr\"om and Kozo Kuchitsu and Roberto Marquardt and Ian Mills and
+ Franco Pavese and Martin Quack and J\"urgen Stohner and Herbert L. Strauss and
+ Michio Takami and Anders J Thor} ,
+ title = {``Quantities, Symbols and Units in Physical Chemistry'', \acs{iupac}
+ Green Book} ,
+ sorttitle = {Quantities, Symbols and Units in Physical Chemistry} ,
+ indexsorttitle = {Quantities, Symbols and Units in Physical Chemistry} ,
+ edition = {3rd Edition. 2nd Printing} ,
+ year = {2008} ,
publisher = {\acs{iupac} \&\ RSC Publishing, Cambridge}
}
@book{iupac:redbook,
author = {Neil G. Connelly and Ture Damhus and Richard M. Hartshorn and
- Alan T. Hutton},
- title = {“Nomenclature of Inorganic Chemistry”, \acs{iupac} Red Book},
- year = {2005},
- publisher = { \acs{iupac} \&\ RSC Publishing, Cambridge},
+ Alan T. Hutton} ,
+ title = {``Nomenclature of Inorganic Chemistry'', \acs{iupac} Red Book} ,
+ sorttitle = {Nomenclature of Inorganic Chemistry} ,
+ indexsorttitle = {Nomenclature of Inorganic Chemistry} ,
+ year = {2005} ,
+ publisher = { \acs{iupac} \&\ RSC Publishing, Cambridge} ,
isbn = {0-85404-438-8}
}
+@book{iupac:bluebook,
+ author = {R. Panico and W. H. Powell and J-C. Richer},
+ title = {``Nomenclature of Organic Chemistry, Sections A, B, C, D, E, F,
+ and H'', \acs{iupac} Blue Book},
+ edition = {\mkbibacro{draft}},
+ date = {2004-10-07},
+ url =
+ {http://old.iupac.org/reports/provisional/abstract04/BB-prs310305/CompleteDraft.pdf},
+ urldate = {2013-07-07}
+}
@misc{eu:ghsystem_regulation,
author = {{The European Parliament and The Council of the European Union}},
- title = {Regulation (EC) No 1272/2008 of the European Parliament and of the Council},
- subtitle = {on classification, labelling and packaging of substances and mixtures,
- amending and repealing Directives 67/548/EEC and 1999/45/EC, and amending
- Regulation (EC) No 1907/2006},
- journal = {Official Journal of the European Union},
+ title = {Regulation (EC) No 1272/2008 of the European Parliament and of
+ the Council} ,
+ subtitle = {on classification, labelling and packaging of substances and
+ mixtures, amending and repealing Directives 67/548/EEC and 1999/45/EC, and
+ amending Regulation (EC) No 1907/2006} ,
+ journal = {Official Journal of the European Union} ,
date = {2008-12-16}
}
@online{unece:ghsystem_implementation,
- author = {United Nations Economic Commission for Europe},
- title = {GHS Implementation},
- url = {http://www.unece.org/trans/danger/publi/ghs/implementation_e.html},
- urldate = {2012-03-20},
+ author = {{United Nations Economic Commission for Europe}} ,
+ title = {GHS Implementation} ,
+ url =
+ {http://www.unece.org/trans/danger/publi/ghs/implementation_e.html} ,
+ urldate = {2012-03-20} ,
date = {2012-03-20}
}
\end{filecontents*}
@@ -222,144 +251,53 @@
\usetikzlibrary{calc,positioning,decorations.pathmorphing,patterns}
-\pgfdeclaredecoration{penciline}{initial}{
- \state{initial}[
- width=+\pgfdecoratedinputsegmentremainingdistance,
- auto corner on length=1mm
- ]{
- \pgfpathcurveto%
- {% From
- \pgfqpoint
- {\pgfdecoratedinputsegmentremainingdistance}
- {\pgfdecorationsegmentamplitude}
- }
- {% Control 1
- \pgfmathrand
- \pgfpointadd
- {\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- {%
- \pgfqpoint
- {-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}%
- {\pgfmathresult\pgfdecorationsegmentamplitude}
- }
- }
- {%TO
- \pgfpointadd
- {\pgfpointdecoratedinputsegmentlast}
- {\pgfpoint{1pt}{1pt}}
- }
- }
- \state{final}{}
-}
-\tikzset{pencil/.style={decorate,decoration=penciline}}
-
-\TitlePicture{%
- \ch[font-spec={Augie}]{
- 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
- ->
- 2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
- }
- \redox(o1,o2)[red,pencil,-cf]{\small\ch[font-spec={[Color=red]Augie},math-space=.3em]{$-$ 2 e-}}
- \redox(r1,r2)[blue,pencil,-cf][-1]{\small\ch[font-spec={[Color=blue]Augie},math-space=.3em]{$+$ 2 e-}}}
-
-\addcmds{
- a, abinitio, AddRxnDesc, anti, aq, aqi,
- b, ba, bond, bottomrule, bridge,
- cancel, cd, cdot, ce, cee, celsius, centering, chemabove, Chemalpha,
- Chembeta, Chemgamma, Chemdelta, ChemDelta, chemfig, chemname, Chemomega,
- chemsetup, cip, cis, ch, clap, cnsetup, CNMR, color, cstack, cstsetup,
- d, D, data, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias,
- DeclareChemIUPAC, DeclareChemLatin, DeclareChemNMR, DeclareChemParticle,
- DeclareChemPhase, DeclareChemReaction, DeclareChemState, DeclareInstance,
- DeclareSIUnit, DeclareTranslation, definecolor, delm, delp, Delta, Dfi,
- draw,
- E, el, electronvolt, ElPot, endo, Enthalpy, enthalpy, Entropy,
- footnotesize, fmch, fpch, fscrm, fscrp,
- g, gas, ghs, ghslistall, ghspic, Gibbs, glqq, gram, grqq,
- H, hapto, HNMR, Helmholtz, hertz, hspace,
- includegraphics, insitu, intertext, invacuo, iupac, IUPAC,
- J, joule,
- Ka, Kb, kilo, Kw,
- L, latin, lc, lewis, Lewis, Lfi, listofreactions, lqd, ltn,
- mch, mega, meta, metre, mhName, midrule, milli, mmHg, mole,
- N, nano, nicefrac, newman, NMR, Nu, Nuc, num, numrange,
- O, ominus, orbital, ortho, oplus, ox, OX,
- p, P, para, pch, per, percent, pgfarrowsdeclarealias, pgfarrowsrenewalias,
- pH, phase, photon, pKa, pKb, pOH, pos, positron, Pot, prt,
- R, Rad, redox, RenewChemArrow, RenewChemBond, RenewChemIUPAC,
- RenewChemLatin, RenewChemNMR, RenewChemParticle, RenewChemPhase,
- RenewChemState, renewtagform, rightarrow,
- S, Sf, sample, scriptscriptstyle, scrm, scrp, second, setatomsep,
- setbondoffset, setchemformula, sfrac, shorthandoff, ShowChemArrow,
- ShowChemBond, si, SI, sisetup, sld, Sod, square, State, subsection,
- textcolor, textendash, textsuperscript, tiny, toprule, trans,
- upbeta, upeta, upgamma,
- val, volt, vphantom, vspave,
- w, xspace, Z
-}
+% \newpackagename\chemmacros{chemmacros}
+\newpackagename\chemformula{chemformula}
+\newpackagename\ghsystem{ghsystem}
+\newpackagename\chemgreek{chemgreek}
-\usepackage{imakeidx}
-\indexsetup{othercode=\footnotesize}
-\makeindex[columns=3,intoc,options={-sl \jobname.ist}]
-\newcommand*\Chemmacros{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemmacros%
- }%
-}
-\providecommand*\chemmacros{{\scshape\textcolor{main}{chemmacros}}\xspace}
+\newidxcmd\manual{\textsf{#1}}[\ (manual)]
-\newcommand*\Chemformula{%
+\newenvironment{codedesc}
{%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemformula%
- }%
-}
-\providecommand*\chemformula{{\scshape\textcolor{main}{chemformula}}\xspace}
+ \def\Code##1{\item\code{##1}\hfill\newline}%
+ \cnltxlist
+ }
+ {\endcnltxlist}
-\newcommand*\Ghsystem{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- ghsystem%
- }%
-}
-\providecommand*\ghsystem{{\scshape\textcolor{main}{ghsystem}}\xspace}
+\renewcommand*\AmS{\hologo{AmS}}
-\newcommand*\Chemgreek{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemgreek%
- }%
-}
-\providecommand*\chemgreek{{\scshape\textcolor{main}{chemgreek}}\xspace}
+\newcommand*\TikZ{Ti\textit{k}Z}
+
+\newcommand*\tablehead[1]{\textrm{\bfseries#1}}
\DeclareChemPhase{\aqi}{aq,$\infty$}% aqueous solution at infinite dilution
\DeclareChemPhase{\cd}{cd}% condensed phase
\DeclareChemPhase{\lc}{lc}% liquid crystal
+\newname\hensel{Martin}{Hensel}
+\newname\pedersen{Bjørn}{Pedersen}
+
\begin{document}
-\part{Preliminaries}\secidx{PRELIMINARIES}
+\part{Preliminaries}
\section{Licence, Requirements and \textsc{README}}
-Permission is granted to copy, distribute and/or modify this software under
-the terms of the \LaTeX\ project public license (lppl) version 1.3 or later
-(\url{http://www.latex-project.org/lppl.txt}). The package has the status
-``maintained.''
-
-The \chemmacros\ bundle needs the bundles \paket{l3kernel} and
-\paket{l3packages}. It also needs the packages \paket{siunitx},
-\paket{mathtools}, \paket{bm}, \paket{nicefrac} and \paket{environ} as well as
-\paket*{tikz}\footnote{\CTANurl[graphics]{pgf}} and the \TikZ libraries
-\code{calc} and \code{arrows}. Language support is done with the help of the
-\paket{translations} package from the \paket{exsheets} bundle. The
+\license
+
+The \chemmacros\ bundle needs the bundles \bnd{l3kernel}~\cite{bnd:l3kernel}
+and \bnd{l3packages}~\cite{bnd:l3packages}. It also needs the packages
+\needpackage{siunitx}~\cite{pkg:siunitx},
+\needpackage{mathtools}~\cite{pkg:mathtools}, \needpackage{bm}~\cite{pkg:bm},
+\needpackage{nicefrac}~\cite{pkg:nicefrac} and
+\needpackage{environ}~\cite{pkg:environ} as well as
+\pkg{tikz}\footnote{\CTANurl[graphics]{pgf}}~\cite{pkg:pgf} and the \TikZ\
+libraries \code{calc} and \code{arrows}. Language support is done with the
+help of the \needpackage{translations}~\cite{pkg:translations}. The
\chemmacros\ package also loads the other packages of this bundle.
-The package option \key{xspace} also loads the package \paket{xspace}.
+The package option \option{xspace} also loads the package
+\pkg{xspace}~\cite{pkg:xspace}.
The \chemmacros\ bundle bundles four packages: \chemmacros, \chemformula,
\ghsystem\ and \chemgreek. The package dependencies of the other packages are
@@ -368,26 +306,26 @@ described in the respective manuals.
\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.
+them as a package. Well -- here we go and you might find it useful, too, I
+hope.
Both the macros and their functionality have changed over time and quite a lot
have been added. Many things have been unified and what's probably most
important: many possibilities to customize have been added, too.
-Probably every chemist using \LaTeXe\ is aware of the great \paket{mhchem}
-package by Martin Hensel. There have always been some difficulties
-intertwining it with \chemmacros, though. Also, some other minor points in
-\paket{mhchem} always bothered me, but they hardly seemed enough for a new
-package. They weren't even enough for a feature request to the \paket{mhchem}
-author. The challenge and the fun of creating a new package and the wish for
-a highly customizable alternative led to \chemformula\ after all.
-
-\chemformula\ works very similar to \paket{mhchem} but is more strict as to
-how compounds, stoichiometric factors and arrows are input. In the same time
-\chemformula\ offers possibilities to customize the output that \paket{mhchem}
+Probably every chemist using \LaTeXe\ is aware of the great \pkg{mhchem}
+package by \hensel. There have always been some difficulties intertwining it
+with \chemmacros, though. Also, some other minor points in \pkg{mhchem}
+always bothered me, but they hardly seemed enough for a new package. They
+weren't even enough for a feature request to the \pkg{mhchem} author. The
+challenge and the fun of creating a new package and the wish for a highly
+customizable alternative led to \chemformula\ after all.
+
+\chemformula\ works very similar to \pkg{mhchem} but is more strict as to how
+compounds, stoichiometric factors and arrows are input. In the same time
+\chemformula\ offers possibilities to customize the output that \pkg{mhchem}
does not. Although \chemformula\ is meant as an \emph{alternative} to
-\paket{mhchem} \chemmacros\ only loads \chemformula\ and uses it at various
+\pkg{mhchem} \chemmacros\ only loads \chemformula\ and uses it at various
places internally, too.
As a chemist you are probably aware of the fact that the \acl{UN} have
@@ -402,763 +340,799 @@ statements and pictograms in a very easy way. The statements are taken from
There are four points I hope I have achieved with this bundle:
\begin{itemize}
- \item intuitive usage as far as the syntax of the commands is concerned
- \item the commands shall not only make typesetting easier and faster but also
- the document source more readable with respect to semantics
- (\code{\cmd{ortho}-dichlorobenzene} is easier to read and understand than
- \code{\cmd*{textit}{o}-dichlorobenzene})
- \item as much customizability as I could think of so every user can adapt the
- commands to his or her own wishes
- \item default settings compliant with the recommendations of the \acf{iupac}.
+ \item intuitive usage as far as the syntax of the commands is concerned
+ \item the commands shall not only make typesetting easier and faster but also
+ the document source more readable with respect to semantics
+ (\code{\cs{ortho}-dichlorobenzene} is easier to read and understand than
+ \code{\cs*{textit}\Marg{o}-dichlorobenzene})
+ \item as much customizability as I could think of so every user can adapt the
+ commands to his or her own wishes
+ \item default settings compliant with the recommendations of the \acf{iupac}.
\end{itemize}
Especially the last point needed some pushing from users to get things right
in many places. If you find anything not compliant with \ac{iupac}
-recommendations\footnote{This does not concern the \cmd{ox} command. The
- \ac{iupac} version is \cmd{ox}*.} I would welcome an email very much!
+recommendations\footnote{This does not concern the \cs{ox} command. The
+ \ac{iupac} version is \cs{ox}\sarg.} I would welcome an email very much!
-\section{News}\secidx{News}
+\section{News}
+\subsection{Version~4.0}
With version~4.0 some changes have been made:
\begin{itemize}
\item first of all the packages \chemformula\ and \ghsystem\ do not load
\chemmacros\ any more which means they can be used independently.
- \item the option \key{bpchem} has been dropped.
- \item the commands \cmd{mch} and \cmd{pch} now match \chemformula's
+ \item the option \option{bpchem} has been dropped.
+ \item the commands \cs{mch} and \cs{pch} now match \chemformula's
charges.
- \item the option \key{method} has been dropped.
- \item the option \key[charges]{append} has deprecated.
- \item the option \key{greek} has been extended to support other uppercase
- greek letters, for example those provided by \paket{kpfonts}. This is
+ \item the option \option{method} has been dropped.
+ \item the option \option{append} has deprecated.
+ \item the option \option{greek} has been extended to support other uppercase
+ greek letters, for example those provided by \pkg{kpfonts}. This is
handled internally by the new package in the family: \chemgreek. This
package is not really a package for usage at a user-level but could in
- principle be used to extend the \key{greek} option.
- \item language support is now done with the help of the
- \paket*{translations} package from the \paket{exsheets} bundle. This
- means that with version~4.0 the document language is recognized
+ principle be used to extend the \option{greek} option.
+ \item language support is now done with the help of the \pkg{translations}.
+ This means that with version~4.0 the document language is recognized
automatically.
- \item the status of the commands \cmd{Lfi} and \cmd{Dfi} has been changed
+ \item the status of the commands \cs{Lfi} and \cs{Dfi} has been changed
from \emph{deprecated} to \emph{dropped}.
\item various other changes like bug fixes and improvements on the
- typographical appearance of \chemformula's inline formulae with \cmd{ch}.
+ typographical appearance of \chemformula's inline formulae with \cs{ch}.
+\end{itemize}
+
+\subsection{Version~4.2}
+
+\begin{itemize}
+ \item Changed particles with electron pairs such as \cs{ba} to use
+ \chemformula's new macro \cs{chlewis} for the Lewis electrons.
+ \item Changed the implicit \cs*{Delta} in the thermodynamic state variables
+ into \cs*{ChemDelta} to ensure that an upright symbol is used.
+ \item Change in the syntax of \cs{DeclareChemState} and
+ \cs{RenewChemState}. The old syntax is still supported but discouraged.
\end{itemize}
-\secidx*{News}
-\section{Package Options}\label{sec:optionen}\secidx{Package Options}
-\chemmacros has several package options. They all are used as key/value pairs like
-\begin{beispiel}[code only]
- \usepackage[option1 = <value1>, option2 = <value2>]{chemmacros}
-\end{beispiel}
+\section{Package Options}\label{sec:options}
+\chemmacros\ has several package options. They all are used as key/value pairs
+like
+\begin{sourcecode}
+ \usepackage[option1 = <value1>, option2 = <value2>]{chemmacros}
+\end{sourcecode}
Some also can be used without value
-(\lstinline+\usepackage[option1]{chemmacros}+), which means that the
+(\verbcode+\usepackage[option1]{chemmacros}+), which means that the
\default{underlined} value is used.
-Both \chemformula and \ghsystem don't have package options of their own. If
+Both \chemformula\ and \ghsystem\ don't have package options of their own. If
you load them explicitly any given option will silently fail. Options can
then only be set using the setup command.
-\begin{beschreibung}
- % circled
- \Option[option]{circled}{\default{formal}|all|none}\Default{formal}
- \chemmacros\ uses two different kinds of charges which indicate the usage
- of real ($+/-$) and formal (\fplus/\fminus) charges. The option
- \code{formal} distinguishes between them, option \code{none} displays them
- all without circle, option \code{all} circles all.
- % circletype
- \Option[option]{circletype}{\default{chem}|math}\default{chem}
- This option switches between two kinds of circled charge symbols:
- \cmd{fplus} \fplus\ and \lstinline+$\oplus$+ $\oplus$.
- % cmversion
- \Option[option]{cmversion}{1|2|3|4|newest}\Default{newest}
- This option restores the old definitions of some commands and tries to
- ensure backwards compatibility as much as possible (default = \code{4}).
- Actually \code{2} and \code{3} are aliases, as are -- for now -- \code{4}
- and \code{newest}. \emph{This option can only be chosen in the preamble}.
- % ghsystem
- \Option[option]{ghsystem}{\default{true}|false}\Default{true}
- Disable the automatic loading of the \ghsystem\ package.
- % greek
- \Option[option]{greek}{\default{auto}|kpfonts|math|newtx|textgreek|upgreek}\Default{auto}
- This option determines how the letters \cmd{Chemalpha} and friends are
- typeset. See page~\pageref{desc:upgreek} for more information. Please
- note that this option \emph{does not load either \paket{upgreek},
- \paket{kpfonts}, \paket{newtxmath} nor \paket{textgreek}!} It only
- determines which one to choose if available. The option \code{auto} will
- detect if either (in order of priority) \paket{upgreek}, \paket{textgreek},
- \paket{kpfonts} or \paket{newtxmath} have been loaded and use them if
- available. If you explicitly choose \code{upgreek}, \code{textgreek},
- \paket{kpfonts} or \paket{newtxmath} you also have to load the
- corresponding package. \emph{This option can only be chosen in the
- preamble}.
- % iupac
- \Option[option]{iupac}{auto|restricted|strict}\Default{auto} Take care of
- how \ac{iupac} naming commands are defined, see page~\pageref{desc:iupac}.
- % language
- \Option[option]{language}{american|british|english|french|german|italian|ngerman}\Default{}
- Load the language used by \chemmacros. \emph{This option can only be
- chosen in the preamble}.
- % Nu
- \Option[option]{Nu}{\default{chemmacros}|mathspec}\Default{chemmacros}
- The package \paket{mathspec} also defines a macro \cmd{Nu}. This option
- chooses which definition holds, see page~\pageref{Nu}. \emph{This option
- can only be chosen in the preamble}.
- % strict
- \Option[option]{strict}{\default{true}|false}\Default{false}
- Setting \key{strict}{true} will turn all warning messages into erros messages.
- % synchronize
- \Option[option]{synchronize}{\default{true}|false}\Default{false}
- The setting \code{true} will tell \chemmacros\ to adapt the font settings
- of \chemformula.
- % xspace
- \Option[option]{xspace}{\default{true}|false}\Default{true}
- With this option most commands are defined with a \cmd*{xspace}.
-\end{beschreibung}
-\secidx*{Package Options}
-
-\section{Setup}\label{sec:setup}\secidx{Setup}
+\begin{options}
+ % circled
+ \keychoice{circled}{\default{formal},all,none}\Module{option}\Default{formal}
+ \chemmacros\ uses two different kinds of charges which indicate the usage
+ of real ($+/-$) and formal (\fplus/\fminus) charges. The option
+ \code{formal} distinguishes between them, option \code{none} displays them
+ all without circle, option \code{all} circles all.
+ % circletype
+ \keychoice{circletype}{\default{chem},math}\Module{option}\Default{chem}
+ This option switches between two kinds of circled charge symbols:
+ \cs{fplus} \fplus\ and \verbcode+$\oplus$+ $\oplus$.
+ % cmversion
+ \keychoice{cmversion}{1,2,3,4,newest}\Module{option}\Default{newest}
+ This option restores the old definitions of some commands and tries to
+ ensure backwards compatibility as much as possible (default = \code{4}).
+ Actually \code{2} and \code{3} are aliases, as are -- for now -- \code{4}
+ and \code{newest}. \emph{This option can only be chosen in the preamble}.
+ % ghsystem
+ \keybool{ghsystem}\Module{option}\Default{true}
+ Disable the automatic loading of the \ghsystem\ package.
+ % greek
+ \keychoice{greek}{\default{auto},kpfonts,math,newtx,textgreek,upgreek}%
+ \Module{option}\Default{auto}
+ This option determines how the letters \cs{Chemalpha} and friends are
+ typeset. See page~\pageref{desc:upgreek} for more information. Please
+ note that this option \emph{does not load either \pkg{upgreek},
+ \pkg{kpfonts}, \pkg{newtxmath} nor \pkg{textgreek}!} It only
+ determines which one to choose if available. The option \code{auto} will
+ detect if either (in order of priority) \pkg{upgreek}, \pkg{textgreek},
+ \pkg{kpfonts} or \pkg{newtxmath} have been loaded and use them if
+ available. If you explicitly choose \code{upgreek}, \code{textgreek},
+ \pkg{kpfonts} or \pkg{newtxmath} you also have to load the
+ corresponding package. \emph{This option can only be chosen in the
+ preamble}.
+ % iupac
+ \keychoice{iupac}{auto,restricted,strict}\Module{option}\Default{auto}
+ Take care of how \ac{iupac} naming commands are defined, see
+ page~\pageref{desc:iupac}.
+ % language
+ \keychoice{language}{american,british,english,french,german,italian,ngerman}%
+ \Module{option}\Default
+ Load the language used by \chemmacros. \emph{This option can only be
+ chosen in the preamble}.
+ % Nu
+ \keychoice{Nu}{\default{chemmacros},mathspec}\Module{option}\Default{chemmacros}
+ The package \pkg{mathspec} also defines a macro \cs{Nu}. This option
+ chooses which definition holds, see page~\pageref{Nu}. \emph{This option
+ can only be chosen in the preamble}.
+ % strict
+ \keybool{strict}\Module{option}\Default{false}
+ Setting \key{strict}{true} will turn all warning messages into erros
+ messages.
+ % synchronize
+ \keybool{synchronize}\Module{option}\Default{false}
+ The setting \code{true} will tell \chemmacros\ to adapt the font settings
+ of \chemformula.
+ % xspace
+ \keybool{xspace}\Module{option}\Default{true}
+ With this option most commands are defined with a \cs*{xspace}.
+\end{options}
+
+
+\section{Setup}\label{sec:setup}
Various of \chemmacros', \chemformula's and \ghsystem's commands have
key/value pairs with which they can be customized. Most times they can be
used as (optional) argument of the commands themselves. They also can most
-times be used with the \cmd{chemsetup} command.
-\begin{beschreibung}
- \Befehl{chemsetup}[<module>]{<key> = <value>} or
- \Befehl{chemsetup}{<module>/<key> = <value>}
-\end{beschreibung}
+times be used with the \cs{chemsetup} command.
+\begin{commands}
+ \command{chemsetup}[\oarg{module}\Marg{\meta{key} = \meta{value}}]
+ Set up the options for module \meta{module} only or
+ \command{chemsetup}[\Marg{\meta{module}/\meta{key} = \meta{value}}]
+ in combination with options from other modules.
+\end{commands}
The keys each belong to a module, which defines for which commands they are
intended for. If a key is presented, you'll see the module to which it
belongs in the left margin. You have two ways to use keys with the
-\cmd{chemsetup}, as you can see above.
+\cs{chemsetup}, as you can see above.
The package options can also be seen as keys belonging to the module
-\textcolor{module}{\code{option}}. This means they can also be used with the
-\cmd{chemsetup} command (except for the option \key[option]{version}{1/2/3}).
-\begin{beispiel}
- \chemsetup[option]{circled=none}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \\
- \chemsetup[option]{circled=formal}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \\
- \chemsetup[option]{circletype=math}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \\
- \chemsetup{option/circletype=chem,option/circled=all}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \\
- \chemsetup{option/circletype=math}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt
-\end{beispiel}
+\module{option}. This means they can also be used with the \cs{chemsetup}
+command (except for the option \choicekey{version}{1,2,3}).
+\begin{example}
+ \chemsetup[option]{circled=none}
+ \leavevmode\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \par
+ \chemsetup[option]{circled=formal}
+ \leavevmode\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \par
+ \chemsetup[option]{circletype=math}
+ \leavevmode\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \par
+ \chemsetup{option/circletype=chem,option/circled=all}%
+ \leavevmode\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \par
+ \chemsetup{option/circletype=math}
+ \leavevmode\mch\ \pch\ \fmch\ \fpch\ \el\ \prt
+\end{example}
Keys \emph{not} belonging to a module \emph{cannot} be used with
-\cmd{chemsetup}!
+\cs{chemsetup}!
+
+All options of \chemformula\ belong to the module \module{chemformula} and all
+of \ghsystem's options belong to the module \module{ghsystem}.
-All options of \chemformula\ belong to the module
-\textcolor{module}{\code{chemformula}} and all of \ghsystem's options belong
-to the module \textcolor{module}{\code{ghsystem}}.
-\secidx*{Setup}
-\section{Language Settings}\label{sec:languages}\secidx{Language Settings}
+\section{Language Settings}\label{sec:languages}
\subsection{Supported Languages}
By choosing the option
-\begin{beispiel}[code only]
- \chemsetup[option]{language=<language>}
-\end{beispiel}
-you can set the language that is used by \chemmacros\ if you want that to be a
-different language than your main document language.
-
-These translate (if the translations are available)
+\begin{commands}
+ \command{chemsetup}[\oarg{option}\Marg{language=\meta{language}}]
+ Selection of the language \meta{language}.
+\end{commands}
+you can set the language that is used by \chemmacros\ if you want it to be a
+\emph{different language than your main document language}.
+
+There are some language definitions made by \chemmacros. They include
\begin{itemize}
- \item The header of the list of reactions.
- \item The beginning of the entries in the list of reactions.
- \item The H- and P-statements of the \ac{ghs}.
+ \item the header of the list of reactions,
+ \item the beginning of the entries in the list of reactions, and
+ \item the H- and P-statements of the \ac{ghs} statements.
\end{itemize}
Currently the following translations are provided:
-\begin{beispiel}[code only]
- % subscript used in \Ka:
- \DeclareTranslation{German}{K-acid}{S}
- % the phases \sld and \lqd:
- \DeclareTranslation{German}{phase-sld}{f}
- \DeclareTranslation{German}{phase-lqd}{f{}l}
- % heading of the list of reactions:
- \DeclareTranslation{English}{list-of-reactions}{List of reactions}
- \DeclareTranslation{German} {list-of-reactions}{Reaktionsverzeichnis}
- \DeclareTranslation{Italian}{list-of-reactions}{Elenco delle reazioni}
- \DeclareTranslation{French} {list-of-reactions}{Table des r\'eactions}
- % name at the beginning of each entry in the list of reactions:
- \DeclareTranslation{English}{lor-reaction}{Reaction }
- \DeclareTranslation{German} {lor-reaction}{Reaktion }
- \DeclareTranslation{Italian}{lor-reaction}{Reazione }
- \DeclareTranslation{French} {lor-reaction}{R\'eaction }
-\end{beispiel}
+\begin{sourcecode}
+ % subscript used in \Ka:
+ \DeclareTranslation{German}{K-acid}{S}
+ % the phases \sld and \lqd:
+ \DeclareTranslation{German}{phase-sld}{f}
+ \DeclareTranslation{German}{phase-lqd}{f{}l}
+ % heading of the list of reactions:
+ \DeclareTranslation{English}{list-of-reactions}{List of reactions}
+ \DeclareTranslation{German} {list-of-reactions}{Reaktionsverzeichnis}
+ \DeclareTranslation{Italian}{list-of-reactions}{Elenco delle reazioni}
+ \DeclareTranslation{French} {list-of-reactions}{Table des r\'eactions}
+ % name at the beginning of each entry in the list of reactions:
+ \DeclareTranslation{English}{lor-reaction}{Reaction }
+ \DeclareTranslation{German} {lor-reaction}{Reaktion }
+ \DeclareTranslation{Italian}{lor-reaction}{Reazione }
+ \DeclareTranslation{French} {lor-reaction}{R\'eaction }
+\end{sourcecode}
All other languages will fall back to English. However, you can always add
the translation you want. If you send me an email with translations you'd
like to have added to \chemmacros\ I'll gladly add them.
\subsection{Specialties}
\subsubsection{German}
-If you choose \code{german/ngerman} the phase commands \cmd{sld} and \cmd{lqd}
-and the command \cmd{pKa} are translated.
+If you choose \code{german/ngerman} the phase commands \cs{sld} and \cs{lqd}
+and the command \cs{pKa} are translated.
\subsubsection{Italian}
\DeclareChemIUPAC{\ter}{\textit{ter}}\DeclareChemIUPAC{\sin}{\textit{sin}}%
Choosing the language \code{italian} defines two additional \ac{iupac} commands:
-\begin{beschreibung}
- \Befehl{ter} \iupac{\ter}
- \Befehl{sin} \iupac{\sin}
-\end{beschreibung}
-\secidx*{Language Settings}
-\secidx*{PRELIMINARIES}
-
-\part{\texorpdfstring{\Chemmacros}{chemmacros}}\secidx{CHEMMACROS}\label{part:chemmacros}
-\section{Particles, Ions and Symbols}\label{sec:teilchen}\secidx{Particles, Ions and Symbols}
-\subsection{Predefined}\secidx[predefined]{Particles, Ions and Symbols}
-
-\chemmacros defines some simple macros for displaying often needed particles
+\begin{commands}
+ \command{ter} \iupac{\ter}
+ \command{sin} \iupac{\sin}
+\end{commands}
+
+\part{\chemmacros}\label{part:chemmacros}
+\section{Particles, Ions and Symbols}\label{sec:particles}
+\subsection{Predefined}
+
+\chemmacros\ defines some simple macros for displaying often needed particles
and symbols. Please note, that they're displayed differently depending on the
-package options used, see section~\ref{sec:optionen}. These commands can be
+package options used, see section~\ref{sec:options}. These commands can be
used in text as well as in math mode. Note that they are not meant to be used
-in \chemformula's \cmd{ch}.
-
-\begin{beschreibung}
- \Befehl{Hpl} \Hpl (proton)
- \Befehl{Hyd} \Hyd (hydroxide)
- \Befehl{HtO} \HtO (oxonium ion) (\textbf{H} \textbf{t}hree \textbf{O})
- \Befehl{water} \water
- \Befehl{el} \el (electron)
- \Befehl{prt} \prt (proton)
- \Befehl{ntr} \ntr (neutron)
- \Befehl{Nu} \Nu (nucleophile).\newline
- The package \paket{mathspec} also defines a macro \cmd{Nu}. If you chose
- package option \key[option]{Nu}{mathspec} \chemmacros\ defines \cmd{Nuc}
- instead\label{Nu}.
- \Befehl{El} \El (electrophile)
- \Befehl{ba} \ba (base)
- \Befehl{fplus} \fplus
- \Befehl{fminus} \fminus
- \Befehl{transitionstatesymbol} \transitionstatesymbol
- \Befehl{standardstate} \standardstate.\newline
- This symbol is only provided by \chemmacros, if the package
- \paket{chemstyle} is not loaded; the idea is borrowed from
- there\footnote{many thanks to the package author
- \href{http://www.texdev.net/}{Joseph Wright}.}.
- \Befehl{Chemalpha} \Chemalpha, \cmd{ChemAlpha} \ChemAlpha\newline
- For each of the 24 greek letters a lowercase and uppercase \cmd*{Chem...}
- command is defined that maps to the upright greek letter as set with the
- option \key{greek}. More details on this can be found in the manual of the
- \chemgreek\ package.
-\end{beschreibung}
-
-The two particles \cmd{Nu} and \cmd{ba} can be modified. To do that you use
+in \chemformula's \cs{ch}.
+
+\begin{commands}
+ \command{Hpl} \Hpl\ (proton)
+ \command{Hyd} \Hyd\ (hydroxide)
+ \command{HtO} \HtO\ (oxonium ion) (\textbf{H} \textbf{t}hree \textbf{O})
+ \command{water} \water
+ \command{el} \el\ (electron)
+ \command{prt} \prt\ (proton)
+ \command{ntr} \ntr\ (neutron)
+ \command{Nu} \Nu\ (nucleophile)\par
+ The package \pkg{mathspec} also defines a macro \cs{Nu}. If you chose
+ package option \keyis{Nu}{mathspec} \chemmacros\ defines \cs{Nuc}
+ instead\label{Nu}.
+ \command{El} \El\ (electrophile)
+ \command{ba} \ba\ (base)
+ \command{fplus} \fplus
+ \command{fminus} \fminus
+ \command{transitionstatesymbol} \transitionstatesymbol
+ \command{standardstate} \standardstate\par
+ This symbol is only provided by \chemmacros, if the package
+ \pkg{chemstyle} is not loaded; the idea is borrowed from
+ there\footnote{many thanks to the package author
+ \href{http://www.texdev.net/}{Joseph Wright}.}.
+ \command{changestate} $\changestate$\par
+ A math operator symbol for denoting the change in an extensive
+ thermodynamic quantity for a process such as \State{H}. This symbol is
+ used in the definitions presented in section~\ref{sec:stand-state-therm}.
+ \command{Chemalpha}[ \Chemalpha, \cs{ChemAlpha} \ChemAlpha]
+ For each of the 24 greek letters a lowercase and uppercase \cs*{Chem...}
+ command is defined that maps to the upright greek letter as set with the
+ option \option{greek}. More details on this can be found in the manual of
+ the \chemgreek\ package.
+\end{commands}
+
+The two particles \cs{Nu} and \cs{ba} can be modified. To do that you use
the option
-\begin{beschreibung}
- \Option[particle]{elpair}{false|\default{dots}|dash}\Default{false}
- Set how the electron pair of the particles \cmd{Nu} and \cmd{ba} are set.
-\end{beschreibung}
-It only has any effect, if the package \paket{chemfig} is loaded, since it uses
-it's command \cmd*{Lewis}.
-\begin{beispiel}
- % needs package `chemfig'
- \ba[elpair] \Nu[elpair=dash]
+\begin{options}
+ \keychoice{elpair}{false,\default{dots},dash}\Module{particle}\Default{false}
+ Set how the electron pair of the particles \cs{Nu} and \cs{ba} are set.
+\end{options}
+\begin{example}[side-by-side]
+ \ba[elpair] \Nu[elpair=dash]
- \chemsetup[particle]{elpair}
- \ba \Nu
-\end{beispiel}
+ \chemsetup[particle]{elpair}
+ \ba\ \Nu
+\end{example}
\label{desc:upgreek}The greek letters aren't newly defined symbols but are
defined differently depending on the packages you've loaded. The default
definition is the corresponding math letter. If you have loaded the
-\paket{textgreek} package the letters are taken from there, and if you have
-loaded the package \paket{upgreek} the macros of that package are used. This
-is also described in the description of the package option \key{greek}, other
+\pkg{textgreek} package the letters are taken from there, and if you have
+loaded the package \pkg{upgreek} the macros of that package are used. This is
+also described in the description of the package option \option{greek}, other
details can be found in the documentation of the \chemgreek\ package. This
-documentation uses \paket{newtxmath} and the setting \key{greek}{newtx} for
+documentation uses \pkg{newtxmath} and the setting \keyis{greek}{newtx} for
instance.
The reason why \chemmacros\ uses these macros in the first place is \ac{iupac}
compliance. \ac{iupac} recommends to use upright greek letters in
nomenclature.
-\begin{zitat}[{\ac{iupac} Green Book {\cite[][p.\,9]{iupac:greenbook}}}]
+\begin{cnltxquote}[{\ac{iupac} Green Book {\cite[][p.\,9]{iupac:greenbook}}}]
Greek letters are used in systematic organic, inorganic, macromolecular and
biochemical nomenclature. These should be roman (upright), since they are
not symbols for physical quantities.
-\end{zitat}
+\end{cnltxquote}
\chemmacros\ uses these commands now to define nomenclature commands, see
page~\pageref{par:greek_letters}.
-\subsection{Own Particles}\secidx[own]{Particles, Ions and Symbols}
+\subsection{Own Particles}
Surely sometimes it can be handy to have other particle macros defined such as
-\cmd*{positron} or \cmd*{photon}. This can easily be done with this command:
-\begin{beschreibung}
- \Befehl{DeclareChemParticle}{<cmd>}\ma{<definition>}
- \Befehl{RenewChemParticle}{<cmd>}\ma{<definition>}
-\end{beschreibung}
-The particle defined this way behaves uses \chemformula' \cmd{ch} to typeset
-the particle which means that the \code{<definition>} should be a vaild
+\cs*{positron} or \cs*{photon}. This can easily be done with this command:
+\begin{commands}
+ \command{DeclareChemParticle}[\marg{cs}\marg{definition}]
+ Define a new particle command.
+ \command{RenewChemParticle}[\marg{cs}\marg{definition}]
+ Renew the definition of a particle command.
+\end{commands}
+The particle defined this way behaves uses \chemformula's \cs{ch} to typeset
+the particle which means that the \meta{definition} should be a vaild
\chemformula\ compound. Please have a look at the \chemformula\ manual for
-details. The particle will obey the \key{circled} option.
-\begin{beispiel}
- \DeclareChemParticle{\positron}{\Chembeta+}
- \DeclareChemParticle{\photon}{\Chemgamma}
- \RenewChemParticle{\el}{\Chembeta-}
- \positron\ \photon\ \el
-\end{beispiel}
-\cmd{DeclareChemParticle} only defines a particle if \code{<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 \code{<cmd>}
-\emph{is} already used and issues a warning/error otherwise.
-\secidx*{Particles, Ions and Symbols}
+details. The particle will obey the \option{circled} option.
+\begin{example}
+ \DeclareChemParticle\positron{\Chembeta+}
+ \DeclareChemParticle\photon{\Chemgamma}
+ \RenewChemParticle\el{\Chembeta-}
+ \positron\ \photon\ \el
+\end{example}
+\cs{DeclareChemParticle} only defines a particle if \meta{cs} 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 \option{strict}.
+\cs{RenewChemParticle} \emph{only} defines a particle if \meta{cs} \emph{is}
+already used and issues a warning/error otherwise.
\section{Nomenclature, Stereo Descriptors, Latin Phrases}\label{sec:stereo}
-\subsection{\acs{iupac} Names}\secidx{IUPAC Names}
+\subsection{\acs{iupac} Names}
-Similar to the \paket{bpchem} package \chemmacros\ provides a
+Similar to the \pkg{bpchem} package \chemmacros\ provides a
command\footnote{The idea and the implementation is shamelessly borrowed from
- \paket*{bpchem} by Bjørn Pedersen.} to typeset \ac{iupac} names. Why is
+ \pkg{bpchem} by \pedersen.} to typeset \ac{iupac} names. Why is
that useful? \ac{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{beschreibung}
- \Befehl{iupac}{<IUPAC name>}\newline
- Inside this command use \cmd{|} and \cmd{-} to indicate a breaking point or
- a breaking dash. Use {\catcode`\^=11\relax\cmd{^}} as a shortcut for
- \cmd*{textsuperscript}. (These commands are similar to the shorthands
- provided by \paket{babel} for certain languages.)
-\end{beschreibung}
-
-\begin{beispiel}
- \begin{minipage}{.4\linewidth}
- \iupac{Tetra\|cyclo[2.2.2.1\^{1,4}]\-un\|decane-2\-dodecyl\-5\-(hepta\|decyl\|iso\|dodecyl\|thio\|ester)}
- \end{minipage}
-\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{|}, \code{-}
-instead of \cmd{-} and \cmd*{textsuperscript} instead of
-{\catcode`\^=11\relax\cmd{^}}.
-
-There are some subtleties: \cmd{-} inserts a small space before the hyphen and
-removes a small space after it. The command \cmd{|} not only prevents
+\begin{commands}
+ \command{iupac}[\marg{IUPAC name}]
+ Inside this command use \cs{\textbar} and \cs{-} to indicate a breaking
+ point or a breaking dash. Use \cs{\textasciicircum} as a shortcut for
+ \cs*{textsuperscript}.
+\end{commands}
+
+\begin{example}
+ \begin{minipage}{.4\linewidth}
+ \iupac{%
+ Tetra\|cyclo[2.2.2.1\^{1,4}]\-un\|decane-2\-dodecyl\-%
+ 5\-(hepta\|decyl\|iso\|dodecyl\|thio\|ester)%
+ }
+ \end{minipage}
+\end{example}
+The \cs{iupac} command is more of a semantic command. Most times you can
+achieve (nearly) the same thing by using \cs{-} instead of \cs{\textbar},
+\code{-} instead of \cs{-} and \cs*{textsuperscript} instead of
+\cs{\textasciicircum}.
+
+There are some subtleties: \cs{-} inserts a small space before the hyphen and
+removes a small space after it. The command \cs{\textbar} not only prevents
ligatures but also inserts a small space.
-\begin{beispiel}
- \huge\iupac{2,4\-Di\|chlor\|pentan} \\
- 2,4-Dichlorpentan
-\end{beispiel}
+\begin{example}[side-by-side]
+ \huge\iupac{2,4\-Di\|chlor\|pentan} \par
+ 2,4-Dichlorpentan
+\end{example}
The spaces inserted by these commands can be customized.
-\begin{beschreibung}
- \Option[iupac]{hyphen-pre-space}{<dim>}\Default{.01em}
- Set the space that is inserted before the hyphen set with \cmd{-}.
- \Option[iupac]{hyphen-post-space}{<dim>}\Default{-.03em}
- Set the space that is inserted after the hyphen set with \cmd{-}.
- \Option[iupac]{break-space}{<dim>}\Default{.01em}
- Set the space inserted by \cmd{|}.
-\end{beschreibung}
-
-The command \cmd{iupac} serves another purpose, too, however. 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
+\begin{options}
+ \keyval{hyphen-pre-space}{dim}\Module{iupac}\Default{.01em}
+ Set the space that is inserted before the hyphen set with \cs{-}.
+ \keyval{hyphen-post-space}{dim}\Module{iupac}\Default{-.03em}
+ Set the space that is inserted after the hyphen set with \cs{-}.
+ \keyval{break-space}{dim}\Module{iupac}\Default{.01em}
+ Set the space inserted by \cs{\textbar}.
+\end{options}
+
+The command \cs{iupac} serves another purpose, too, however. Regardless of
+the setting of the \option{iupac} option all the commands presented in
+this section are always defined \emph{inside} \cs{iupac}. Quite a number of
+the naming commands have very general names: \cs{meta}, \cs{D}, \cs{E},
+\cs{L}, \cs{R}, \cs{S}, \cs{trans} and so forth. This means they either
+are predefined already (\cs{L} \L) or are easily defined by another package
+or class (the \pkg{cool} package defines both \cs{D} and \cs{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{desc:iupac}. It
+way, there is the package option \option{iupac}\label{desc: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.
+ \item \keyis{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} \cs{iupac}.
+ \item \keyis{iupac}{restricted}: all naming commands are \emph{only} defined
+ inside \cs{iupac}. If the commands are defined by another package they of
+ course have that meaning outside. They're not defined outside otherwise.
+ \item \keyis{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 \cs{iupac} then.
\end{itemize}
Table~\ref{tab:iupac_modes} demonstrates the different modes.
\begin{table}[ht]
- \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}
+ \centering
+ \begin{tabular}{lccc}
+ \toprule
+ & auto & restricted & strict \\
+ \midrule
+ \cs{L} & \L & \L & \iupac{\L} \\
+ \cs{iupac}\Marg{\cs{L}} & \iupac{\L} & \iupac{\L} & \iupac{\L} \\
+ \cs{D} & \D & -- & \D \\
+ \cs{iupac}\Marg{\cs{D}} & \iupac{\D} & \iupac{\D} & \iupac{\D} \\
+ \bottomrule
+ \end{tabular}
+ \caption{Demonstration of \option*{iupac}'s modes.}\label{tab:iupac_modes}
\end{table}
-\subsubsection{Predefined Commands}\secidx[predefined]{IUPAC Names}\secidx{Stereo Descriptors and Nomenclature}
+\subsubsection{Predefined Commands}
The macros in this section are intended to make the writing of \ac{iupac}
names more convenient.
-\paragraph{Greek Letters}\label{par:greek_letters}\secidx[greek letters]{IUPAC Names}
+\paragraph{Greek Letters}\label{par:greek_letters}
Greek letters in compound names are typeset upright. For this there are for
-example the packages \paket{upgreek} and \paket{textgreek}. If you have
+example the packages \pkg{upgreek} and \pkg{textgreek}. If you have
loaded one of them\footnote{There are other options, see the description of
- the \key{greek} option.} \chemmacros\ typesets the following commands
-upright:
-\begin{beschreibung}
- \Befehl{a} \iupac{\a}
- \Befehl{b} \iupac{\b}
- \Befehl{g} \iupac{\g}
- \Befehl{d} \iupac{\d}
- \Befehl{k} \iupac{\k}
- \Befehl{m} \iupac{\m}
- \Befehl{n} \iupac{\n}
- \Befehl{w} \iupac{\w}
-\end{beschreibung}
-\begin{beispiel}
- \iupac{5\a\-androstan\-3\b\-ol} \\
- \iupac{\a\-(tri\|chloro\|methyl)\-\w\-chloro\|poly(1,4\-phenylene\|methylene)}
-\end{beispiel}
-
-\paragraph{Hetero Atoms and added Hydrogen}\secidx[hetero atoms]{IUPAC Names}
+ the \option{greek} option.} the following commands typeset upright Greek
+letters:
+\begin{itemize}
+ \item[]
+ \cs{a} \iupac{\a} \quad
+ \cs{b} \iupac{\b} \quad
+ \cs{g} \iupac{\g} \quad
+ \cs{d} \iupac{\d} \quad
+ \cs{k} \iupac{\k} \quad
+ \cs{m} \iupac{\m} \quad
+ \cs{n} \iupac{\n} \quad
+ \cs{w} \iupac{\w}
+\end{itemize}
+\begin{example}
+ \iupac{5\a\-androstan\-3\b\-ol} \par
+ \iupac{\a\-(tri\|chloro\|methyl)\-\w\-chloro\|poly(1,4\-phenylene\|methylene)}
+\end{example}
+
+\paragraph{Hetero Atoms and added Hydrogen}
Attachments to hetero atoms and added hydrogen atoms are indicated by italic
letters~\cite{iupac:greenbook}. \chemmacros\ defines a few shortcuts for the
most common ones.
-\begin{beschreibung}
- \Befehl{H} \iupac{\H}
- \Befehl{O} \iupac{\O}
- \Befehl{N} \iupac{\N}
- \Befehl{Sf} \iupac{\Sf}
- \Befehl{P} \iupac{\P}
-\end{beschreibung}
-\begin{beispiel}
- \iupac{\N\-methyl\|benz\|amide} \\
- \iupac{3\H\-pyrrole} \\
- \iupac{\O\-ethyl hexanethioate}
-\end{beispiel}
-
-\paragraph{Cahn-Ingold-Prelog}\index{Cahn-Ingold-Prelog}\secidx[Cahn-Ingold-Prelog]{IUPAC Names}\label{par:cip}
-\begin{beschreibung}
- \Befehl{cip}{<conf>} \eg: \cmd{cip}{R,S} \cip{R,S}
- \Befehl{R} \iupac{\R}
- \Befehl{S} \iupac{\S}
-\end{beschreibung}
-Since the command \cmd{S} has another meaning already (\S) it is only
-available inside \cmd{iupac} in the default setting.
+\begin{itemize}
+ \item[]
+ \cs{H} \iupac{\H} \quad
+ \cs{O} \iupac{\O} \quad
+ \cs{N} \iupac{\N} \quad
+ \cs{Sf} \iupac{\Sf} \quad
+ \cs{P} \iupac{\P}
+\end{itemize}
+\begin{example}[side-by-side]
+ \iupac{\N\-methyl\|benz\|amide} \par
+ \iupac{3\H\-pyrrole} \par
+ \iupac{\O\-ethyl hexanethioate}
+\end{example}
+
+\paragraph{Cahn-Ingold-Prelog}\label{par:cip}
+\begin{commands}
+ \command{cip}[\marg{conf}]
+ Typeset Cahn-Ingol-Prelog descriptors, \eg: \cs{cip}\Marg{R,S} \cip{R,S}
+ \command{R}[ \iupac{\R}]
+ Typeset recto descriptor.
+ \command{S}[ \iupac{\S}]
+ Typeset sinister descriptor.
+\end{commands}
+Since the command \cs{S} has another meaning already (\S) it is only
+available inside \cs{iupac} in the default setting.
Both these commands and the entgegen/zusammen descriptors get a small
additional amount of kerning after the closing parenthesis. This amount can
be changed through the following option:
-\begin{beschreibung}
- \Option[iupac]{cip-kern}{<dim>}\Default{.075em}
- Set the amount of kerning after the closing parenthesis.
-\end{beschreibung}
-
-\paragraph{Fischer}\index{Fischer}\secidx[Fischer]{IUPAC Names}
-\begin{beschreibung}
- \Befehl{D} \iupac{\D}
- \Befehl{L} \iupac{\L}
-\end{beschreibung}
-Since the command \cmd{L} has another meaning already (\L) it is only
-available inside \cmd{iupac} in the default setting.
+\begin{options}
+ \keyval{cip-kern}{dim}\Module{iupac}\Default{.075em}
+ Set the amount of kerning after the closing parenthesis.
+\end{options}
+
+\paragraph{Fischer}\index{Fischer}
+\begin{itemize}
+ \item[]
+ \cs{D} \iupac{\D} \quad
+ \cs{L} \iupac{\L}
+\end{itemize}
+Since the command \cs{L} has another meaning already (\L) it is only
+available inside \cs{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}
-
-\begin{beschreibung}
- \Befehl{cis} \cis
- \Befehl{trans} \trans
- \Befehl{Z} \Z
- \Befehl{E} \E
- \Befehl{syn} \syn
- \Befehl{anti} \anti
- \Befehl{tert} \tert
-\end{beschreibung}
-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{beschreibung}
- \Befehl{ortho} \ortho
- \Befehl{meta} \meta
- \Befehl{para} \para
-\end{beschreibung}
-Although these commands are provided I like to cite~\cite{iupac:bluebook}:
+\begin{itemize}
+ \item[]
+ \cs{cis} \iupac{\cis} \quad
+ \cs{trans} \iupac{\trans} \quad
+ \cs{Z} \iupac{\Z} \quad
+ \cs{E} \iupac{\E} \quad
+ \cs{syn} \iupac{\syn} \quad
+ \cs{anti} \iupac{\anti} \quad
+ \cs{tert} \iupac{\tert}
+\end{itemize}
+The package \pkg{cool} defines the commands \cs{E} and \cs{D}, too. If you
+load it, the \chemmacros\ version will only be available inside \cs{iupac} in
+the default setting.
-\begin{zitat}[{\acs{iupac} Blue Book {\cite[][p.\,90]{iupac:bluebook}}}]
- The letters \ortho, \meta, and \para\ have been used in place of
- \textit{ortho}, \textit{meta}, and \textit{para}, respectively, to designate
- the 1,2- 1,3-, and 1,4- isomers of disubstituted benzene. This usage is
- strongly discouraged and is not used in preferred \acs{iupac} names.
-\end{zitat}
+\paragraph{ortho/meta/para}
+\begin{itemize}
+ \item[]
+ \cs{ortho} \iupac{\ortho} \quad
+ \cs{meta} \iupac{\meta} \quad
+ \cs{para} \iupac{\para}
+\end{itemize}
-\paragraph{Absolute Configuration}\index{absolute configuration} (uses \TikZ)
-\begin{beschreibung}
- \Befehl{Rconf}[<letter>] \cmd{Rconf}: \Rconf \quad\cmd{Rconf}[]: \Rconf[]
- \Befehl{Sconf}[<letter>] \cmd{Sconf}: \Sconf \quad\cmd{Sconf}[]: \Sconf[]
-\end{beschreibung}
+Although these commands are provided I like to cite~\cite{iupac:bluebook}:
+
+\begin{cnltxquote}[{\acs{iupac} Blue Book {\cite[][p.\,90]{iupac:bluebook}}}]
+ The letters \iupac{\ortho}, \iupac{\meta}, and \iupac{\para} have been used
+ in place of \textit{ortho}, \textit{meta}, and \textit{para}, respectively,
+ to designate the 1,2- 1,3-, and 1,4- isomers of disubstituted benzene. This
+ usage is strongly discouraged and is not used in preferred \acs{iupac}
+ names.
+\end{cnltxquote}
+
+\paragraph{Absolute Configuration} (uses \TikZ)
+\begin{commands}
+ \command{Rconf}[\oarg{letter}]
+ \cs{Rconf}: \Rconf \quad \cs{Rconf}\oarg{}: \Rconf[]
+ \command{Sconf}[\oarg{letter}]
+ \cs{Sconf}: \Sconf \quad \cs{Sconf}\oarg{}: \Sconf[]
+\end{commands}
Examples:
-\begin{beispiel}
- \iupac{\D\-Wein\|s\"aure} = \\
- \iupac{\cip{2S,3S}\-Wein\|s\"aure} \\
- \iupac{\D\-($-$)\-Threose} = \\
- \iupac{\cip{2S,3R}\-($-$)\-2,3,4\-Tri\|hydroxy\|butanal} \\
- \iupac{\cis\-2\-Butene} = \\
- \iupac{\Z\-2\-Butene}, \\
- \iupac{\cip{2E,4Z}\-Hexa\|diene} \\
- \iupac{\meta\-Xylol} = \\
- \iupac{1,3\-Di\|methyl\|benzene}
-\end{beispiel}
-\secidx*{Stereo Descriptors and Nomenclature}
+\begin{example}
+ \iupac{\D\-Wein\|s\"aure} =
+ \iupac{\cip{2S,3S}\-Wein\|s\"aure} \par
+ \iupac{\D\-($-$)\-Threose} =
+ \iupac{\cip{2S,3R}\-($-$)\-2,3,4\-Tri\|hydroxy\|butanal} \par
+ \iupac{\cis\-2\-Butene} =
+ \iupac{\Z\-2\-Butene}, \par
+ \iupac{\cip{2E,4Z}\-Hexa\|diene} \par
+ \iupac{\meta\-Xylol} =
+ \iupac{1,3\-Di\|methyl\|benzene}
+\end{example}
\paragraph{Coordination Chemistry}
\chemmacros\ provides two commands useful with coordination chemistry:
-\begin{beschreibung}
- \Befehl{bridge}{<num>} \bridge{3}
- \Befehl{hapto}{<num>} \hapto{5}
-\end{beschreibung}
-\begin{beispiel}
- Ferrocene = \iupac{bis(\hapto{5}cyclo\|penta\|dienyl)iron} \\
- \iupac{tetra\-\bridge{3}iodido\-tetrakis[tri\|methyl\|platinum(IV)]}
-\end{beispiel}
+\begin{itemize}
+ \item[]
+ \cs{bridge}\marg{num} \bridge{3} \quad
+ \cs{hapto}\marg{num} \hapto{5}
+\end{itemize}
+\begin{example}
+ Ferrocene = \iupac{bis(\hapto{5}cyclo\|penta\|dienyl)iron} \par
+ \iupac{tetra\-\bridge{3}iodido\-tetrakis[tri\|methyl\|platinum(IV)]}
+\end{example}
Two options allow customization:
-\begin{beschreibung}
- \Option[iupac]{bridge-number}{sub|super}\Default{sub}
- Appends the number as a subscript or superscript. \ac{iupac}
- recommendation is the subscript \cite{iupac:redbook}.
- \Option[iupac]{coord-use-hyphen}{\default{true}|false}\Default{true}
- Append a hyphen to \cmd{hapto} and \cmd{bridge} or don't.
-\end{beschreibung}
+\begin{options}
+ \keychoice{bridge-number}{sub,super}\Module{iupac}\Default{sub}
+ Appends the number as a subscript or superscript. \ac{iupac}
+ recommendation is the subscript~\cite{iupac:redbook}.
+ \keybool{coord-use-hyphen}\Module{iupac}\Default{true}
+ Append a hyphen to \cs{hapto} and \cs{bridge} or don't.
+\end{options}
-\subsubsection{Own Naming Commands}\secidx[own]{IUPAC Names}
+\subsubsection{Own Naming Commands}
If you find any commands missing you can define them using
-\begin{beschreibung}
- \Befehl{DeclareChemIUPAC}{<cmd>}\ma{<declaration>}
- \Befehl{RenewChemIUPAC}{<cmd>}\ma{<declaration>}
-\end{beschreibung}
+\begin{commands}
+ \command{DeclareChemIUPAC}[\marg{cs}\marg{declaration}]
+ Define a new \ac{iupac} command that is in any case defined inside of
+ \cs{iupac} regardless if \meta{cs} is defined elsewhere already.
+ \command{RenewChemIUPAC}[\marg{cs}\marg{declaration}]
+ Redefine an existing \ac{iupac} command that is in any case defined inside
+ of \cs{iupac} regardless if \meta{cs} is defined elsewhere already.
+\end{commands}
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
+\option{iupac}. This means any existing command is only overwritten with
+\keyis{iupac}{strict}. However, \cs{DeclareChemIUPAC} will \emph{not} change
the definition of an existing \ac{iupac} naming command but issue a warning/an
-error (depending on the package option \key{strict}) if the \ac{iupac} naming
-command already exists.
-\begin{beispiel}
- \DeclareChemIUPAC\endo{\textit{endo}}
- \RenewChemIUPAC\anti{\textit{anti}}
- \iupac{(2\-\endo,7\-\anti)\-2\-bromo\-7\-fluoro\|bicyclo[2.2.1]heptane}
-\end{beispiel}
-
-\cmd{RenewChemIUPAC} allows you to redefine the existing \ac{iupac} naming
+error (depending on the package option \option{strict}) if the \ac{iupac}
+naming command already exists.
+\begin{example}
+ \DeclareChemIUPAC\endo{\textit{endo}}
+ \RenewChemIUPAC\anti{\textit{anti}}
+ \iupac{(2\-\endo,7\-\anti)\-2\-bromo\-7\-fluoro\|bicyclo[2.2.1]heptane}
+\end{example}
+
+\cs{RenewChemIUPAC} allows you to redefine the existing \ac{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}
-
-The package \paket{chemstyle} provides the command \cmd{latin} to typeset
-common latin phrases in a consistent way. \chemmacros\ defines a similar
-\cmd{latin} only if \paket{chemstyle} has \emph{not} been loaded and
-additionally provides these commands:
-\begin{beschreibung}
- \Befehl{insitu} \insitu
- \Befehl{abinitio} \abinitio
- \Befehl{invacuo} \invacuo
-\end{beschreibung}
-
-If the package \paket{chemstyle} has been loaded they are defined using
-\paket{chemstyle}'s \cmd{latin} command. This means that then the appearance
-depends on \paket{chemstyle}'s option \code{abbremph}.
+\begin{example}[side-by-side]
+ \iupac{\meta\-Xylol} \par
+ \RenewChemIUPAC\meta{\textup{m}}
+ \iupac{\meta\-Xylol}
+\end{example}
+
+\subsection{Latin Phrases}
+
+The package \pkg{chemstyle} provides the command \cs{latin} to typeset common
+latin phrases in a consistent way. \chemmacros\ defines a similar \cs{latin}
+only if \pkg{chemstyle} has \emph{not} been loaded and additionally provides
+these commands:
+\begin{itemize}
+ \item[]
+ \cs{insitu} \insitu \quad
+ \cs{abinitio} \abinitio \quad
+ \cs{invacuo} \invacuo
+\end{itemize}
+
+If the package \pkg{chemstyle} has been loaded they are defined using
+\pkg{chemstyle}'s \cs{latin} command. This means that then the appearance
+depends on \pkg{chemstyle}'s option \code{abbremph}.
The commands are defined through
-\begin{beschreibung}
- \Befehl{DeclareChemLatin}{<cmd>}\ma{<phrase>}
- \Befehl{RenewChemLatin}{<cmd>}\ma{<phrase>}
-\end{beschreibung}
-\begin{beispiel}
- \DeclareChemLatin\ltn{latin text}
- \ltn
-\end{beispiel}
-If you have \emph{not} loaded \paket{chemstyle} you can change the appearance
+\begin{commands}
+ \command{DeclareChemLatin}[\marg{cs}\marg{phrase}]
+ Define a new latin phrase.
+ \command{RenewChemLatin}[\marg{cs}\marg{phrase}]
+ Redefine an existing latin phrase.
+\end{commands}
+\begin{example}[side-by-side]
+ \DeclareChemLatin\ltn{latin text}\ltn
+\end{example}
+If you have \emph{not} loaded \pkg{chemstyle} you can change the appearance
with this option:
-\begin{beschreibung}
- \Option[latin]{format}{<definition>}\Default{\cmd*{itshape}}
- Set the format of the latin phrases.
-\end{beschreibung}
-\secidx*{Latin Phrases}
-
-\section{Units for the Usage With \textsf{siunitx}}\label{sec:einheiten}\secidx{Units}
-
-In chemistry some non-SI units are very common. \paket{siunitx} provides the
-command \cmd*{DeclareSIUnit}{<command>}\ma{<unit>} to add arbitrary units.
-\chemmacros\ uses that command to provide some units. Like all
-\paket{siunitx} units they're only valid inside \cmd*{SI}{<num>}\ma{<unit>}
-and \cmd*{si}{<unit>}.
-\begin{beschreibung}
- \Befehl{atmosphere} \si{\atmosphere}
- \Befehl{atm} \si{\atm}
- \Befehl{calory} \si{\calory}
- \Befehl{cal} \si{\cal}
- \Befehl{cmc} \si{\cmc}\newline
- The units \cmd{cmc}, \cmd{molar}, and \cmd{Molar} are defined by the
- package \paket{chemstyle} as well. \chemmacros\ only defines them, if
- \paket{chemstyle} is not loaded.
- \Befehl{molar} \si{\molar}
- \Befehl{moLar} \si{\moLar}
- \Befehl{Molar} \si{\Molar}
- \Befehl{MolMass} \si{\MolMass}
- \Befehl{normal} \si{\normal}
- \Befehl{torr} \si{\torr}
-\end{beschreibung}
-
-By the way: \cmd*{mmHg} \si{\mmHg} already is defined by \paket{siunitx} and
-\paket{chemstyle}.
-\secidx*{Units}
-
-\section{Acid/Base}\label{sec:saeure_base}\secidx{Acid/Base}
-
-Easy representation of \pH, \pKa \ldots\ (the command \cmd{pKa} depends on the
-package option \key[option]{language}). The translations may be adapted,
-though, see section~\ref{sec:languages}.
-\begin{beschreibung}
- \Befehl{pH} \pH
- \Befehl{pOH} \pOH
- \Befehl{Ka} \Ka
- \Befehl{Kb} \Kb
- \Befehl{Kw} \Kw
- \Befehl{pKa}[<num>] \cmd{pKa}: \pKa, \cmd{pKa}[1]: \pKa[1]
- \Befehl{pKb}[<num>] \cmd{pKb}: \pKb, \cmd{pKb}[1]: \pKb[1]
- \Befehl{p}{<anything>} \eg \cmd{p}{\cmd{Kw}} \p{\Kw}
-\end{beschreibung}
-
-\begin{beispiel}
- \Ka \Kb \pKa \pKa[1] \pKb \pKb[1]
-\end{beispiel}
-
-\achtung{The default appearance of the \p{}-commands has changed to follow
- \ac{iupac} recommendations.}
-\begin{zitat}[{\acs{iupac} Green Book {\cite[][p.\,103]{iupac:greenbook}}}]
+\begin{options}
+ \keyval{format}{definition}\Module{latin}\Default{\cs*{itshape}}
+ Set the format of the latin phrases.
+\end{options}
+
+\section{Units for the Usage With \pkg*{siunitx}}\label{sec:einheiten}
+
+In chemistry some non-SI units are very common. \pkg{siunitx} provides the
+command \cs*{DeclareSIUnit}\marg{command}\marg{unit} to add arbitrary units.
+\chemmacros\ uses that command to provide some units. Like all \pkg{siunitx}
+units they're only valid inside \cs*{SI}\marg{num}\marg{unit} and
+\cs*{si}\marg{unit}.
+\begin{commands}
+ \command{atmosphere} \si{\atmosphere}
+ \command{atm} \si{\atm}
+ \command{calory} \si{\calory}
+ \command{cal} \si{\cal}
+ \command{cmc} \si{\cmc} \par
+ The units \cs{cmc}, \cs{molar}, and \cs{Molar} are defined by the
+ package \pkg{chemstyle} as well. \chemmacros\ only defines them, if
+ \pkg{chemstyle} is not loaded.
+ \command{molar} \si{\molar}
+ \command{moLar} \si{\moLar}
+ \command{Molar} \si{\Molar}
+ \command{MolMass} \si{\MolMass}
+ \command{normal} \si{\normal}
+ \command{torr} \si{\torr}
+\end{commands}
+
+By the way: \cs*{mmHg} \si{\mmHg} already is defined by \pkg{siunitx} and
+\pkg{chemstyle}.
+
+\section{Acid/Base}\label{sec:saeure_base}
+
+Easy representation of \pH, \pKa \ldots\ (the command \cs{pKa} depends on the
+package option \option{language}). The translations may be adapted, though,
+see section~\ref{sec:languages}.
+\begin{commands}
+ \command{pH} \pH
+ \command{pOH} \pOH
+ \command{Ka} \Ka
+ \command{Kb} \Kb
+ \command{Kw} \Kw
+ \command{pKa}[\oarg{num}] \cs{pKa}: \pKa, \cs{pKa}\Oarg{1}: \pKa[1]
+ \command{pKb}[\oarg{num}] \cs{pKb}: \pKb, \cs{pKb}\Oarg{1}: \pKb[1]
+ \command{p}[\marg{anything}] \eg\ \cs{p}\Marg{\cs{Kw}} \p{\Kw}
+\end{commands}
+
+\begin{example}[side-by-side]
+ \Ka \Kb \pKa \pKa[1] \pKb \pKb[1]
+\end{example}
+
+\begin{cnltxquote}[{\acs{iupac} Green Book {\cite[][p.\,103]{iupac:greenbook}}}]
The operator \p{} \textelp{} shall be printed in Roman type.
-\end{zitat}
+\end{cnltxquote}
There is one option which changes the style the \p{} is typeset:
-\begin{beschreibung}
- \Option[acid-base]{p-style}{italics|slanted|upright}\Default{upright}
- Set the style of the \p{} operator.
-\end{beschreibung}
-\begin{beispiel}
- \pH, \pKa
-
- \chemsetup[acid-base]{p-style=slanted} \pH, \pKa
-
- \chemsetup[acid-base]{p-style=italics} \pH, \pKa
-\end{beispiel}
-\secidx*{Acid/Base}
+\begin{options}
+ \keychoice{p-style}{italics,slanted,upright}\Module{acid-base}\Default{upright}
+ Set the style of the \p{} operator.
+\end{options}
+\begin{example}
+ \pH, \pKa \par
+ \chemsetup[acid-base]{p-style=slanted} \pH, \pKa \par
+ \chemsetup[acid-base]{p-style=italics} \pH, \pKa
+\end{example}
\section{Oxidation Numbers, Real and Formal Charges}\label{sec:ladungen}
\chemmacros\ distinguishes between real ($+$/$-$) and formal (\fplus/\fminus)
-charge symbols, also see section~\ref{sec:optionen}. All commands using
-formal charge symbols start with a \code{f}.
+charge symbols, also see section~\ref{sec:options}. All commands using formal
+charge symbols start with a \code{f}.
-\subsection{Ion Charges}\label{ssec:ionen}\secidx{Ion Charges}
+\subsection{Ion Charges}\label{ssec:ionen}
Simple displaying of (real) charges. It is worth noting that these commands
really are relicts from a time when \chemmacros\ tried hard to be compliant
-with \paket{mhchem} and \chemformula didn't exist, yet. They are still
-provided for backwards compatibility but \emph{my recommendation is to use}
-\cmd{ch} (see the documentation of the \chemformula\ package) \emph{and forget
- about these commands:}
-\begin{beschreibung}
- \Befehl{pch}[<number>] positive charge (\textbf{p}lus + \textbf{ch}arge)
- \Befehl{mch}[<number>] negative charge (\textbf{m}inus + \textbf{ch}arge)
-\end{beschreibung}
-
-\begin{beispiel}
- \pch, Na\pch, Ca\pch[2]\\
- \mch, F\mch, S\mch[2]
-\end{beispiel}
+with \pkg{mhchem} and \chemformula\ didn't exist, yet. They are still provided
+for backwards compatibility but \emph{my recommendation is to use} \cs{ch}
+(see the documentation of the \chemformula\ package) \emph{and forget about
+ these commands:}
+\begin{commands}
+ \command{pch}[\oarg{number}]
+ positive charge (\textbf{p}lus + \textbf{ch}arge)
+ \command{mch}[\oarg{number}]
+ negative charge (\textbf{m}inus + \textbf{ch}arge)
+\end{commands}
+
+\begin{example}[side-by-side]
+ \leavevmode
+ \pch, Na\pch, Ca\pch[2]\par
+ \leavevmode
+ \mch, F\mch, S\mch[2]
+\end{example}
The same for formal charges:
-\begin{beschreibung}
- \Befehl{fpch}[<number>] positive charge
- \Befehl{fmch}[<number>] negative charge
-\end{beschreibung}
+\begin{commands}
+ \command{fpch}[\oarg{number}]
+ positive charge
+ \command{fmch}[\oarg{number}]
+ negative charge
+\end{commands}
-\begin{beispiel}
- \fpch\ \fmch\ \fpch[3] \fmch[3]
-\end{beispiel}
-\secidx*{Ion Charges}
+\begin{example}[side-by-side]
+ \leavevmode
+ \fpch\ \fmch\ \fpch[3] \fmch[3]
+\end{example}
-\subsection{Oxidation Numbers}\label{ssec:oxidationszahlen}\secidx{Oxidation Numbers}
+\subsection{Oxidation Numbers}\label{ssec:oxidationszahlen}
Typesetting oxidation numbers:
-\begin{beschreibung}
- \Befehl{ox}[<keyval>]{<number>,<atom>}\newline
- Places \code{<number>} above \code{<atom>}; \code{<number>} has to be a
- (rational) number!
-\end{beschreibung}
-
-\begin{beispiel}
- \ox{+1,Na}, \ox{2,Ca}, \ox{-2,S}, \ox{-1,F}
-\end{beispiel}
-
-There are a number of keys, that can be used to modify the \cmd{ox} command.
-\begin{beschreibung}
- \Option[ox]{parse}{\default{true}|false}\Default{true}
- When \code{false} an arbitrary entry can be used for \code{<number>}.
- \Option[ox]{roman}{\default{true}|false}\Default{false}
- Switches from roman to arabic numbers.
- \Option[ox]{pos}{top|super|side}\Default{top}
- \code{top} places \code{<number>} above \code{<atom>}, \code{super} to the
- upper right as superscript and \code{side} to the right and inside
- brackets.
- \Option[ox]{explicit-sign}{\default{true}|false}\Default{false}
- Shows the $+$ for positiv numbers and the $\pm$ for $0$.
- \Option[ox]{decimal-marker}{comma|point}\Default{point}
- Choice for the decimal marker for formal oxidation numbers like \ox{1.2,X}.
- \Option[ox]{align}{center|right}\Default{center}
- Center the oxidation number relative to the atom or right-align it.
-\end{beschreibung}
-
-\begin{beispiel}
- \ox[roman=false]{2,Ca} \ox{2,Ca} \\
- \ox[pos=super]{3,Fe}-Oxide \\
- \ox[pos=side]{3,Fe}-Oxide \\
- \ox[parse=false]{?,Mn} \\
- \ox[align=right]{2,Ca}
-\end{beispiel}
-
-The \key[ox]{pos}{super} variant also can be set with the shortcut \cmd{ox}*:
-\begin{beispiel}
- \ox{3,Fe} \ox*{3,Fe}
-\end{beispiel}
-
-Using the \key[ox]{explicit-sign} key will always show the sign of the
+\begin{commands}
+ \command{ox}[\oarg{options}\Marg{\meta{number},\meta{atom}}]
+ Places \meta{number} above \meta{atom}; \meta{number} has to be a
+ (rational) number!
+\end{commands}
+
+\begin{example}
+ \ox{+1,Na}, \ox{2,Ca}, \ox{-2,S}, \ox{-1,F}
+\end{example}
+
+There are a number of keys, that can be used to modify the \cs{ox} command.
+\begin{options}
+ \keybool{parse}\Module{ox}\Default{true}
+ When \code{false} an arbitrary entry can be used for \code{<number>}.
+ \keybool{roman}\Module{ox}\Default{false}
+ Switches from roman to arabic numbers.
+ \keychoice{pos}{top,super,side}\Module{ox}\Default{top}
+ \code{top} places \meta{number} above \meta{atom}, \code{super} to the
+ upper right as superscript and \code{side} to the right and inside
+ brackets.
+ \keybool{explicit-sign}\Module{ox}\Default{false}
+ Shows the $+$ for positiv numbers and the $\pm$ for $0$.
+ \keychoice{decimal-marker}{comma,point}\Module{ox}\Default{point}
+ Choice for the decimal marker for formal oxidation numbers like \ox{1.2,X}.
+ \keychoice{align}{center,right}\Module{ox}\Default{center}
+ Center the oxidation number relative to the atom or right-align it.
+\end{options}
+
+\begin{example}[side-by-side]
+ \ox[roman=false]{2,Ca} \ox{2,Ca} \\
+ \ox[pos=super]{3,Fe}-Oxide \\
+ \ox[pos=side]{3,Fe}-Oxide \\
+ \ox[parse=false]{?,Mn} \\
+ \ox[align=right]{2,Ca}
+\end{example}
+
+The \keyis{pos}{super} variant also can be set with the shortcut \cs{ox}\sarg:
+\begin{example}[side-by-side]
+ \ox{3,Fe} \ox*{3,Fe}
+\end{example}
+
+Using the \option{explicit-sign} key will always show the sign of the
oxidation number:
-\begin{beispiel}
- \chemsetup[ox]{explicit-sign = true}
- \ox{+1,Na}, \ox{2,Ca}, \ox{-2,S}, \ch{"\ox{0,F}" {}2}
-\end{beispiel}
+\begin{example}
+ \chemsetup[ox]{explicit-sign = true}
+ \ox{+1,Na}, \ox{2,Ca}, \ox{-2,S}, \ch{"\ox{0,F}" {}2}
+\end{example}
-\begin{beispiel}
- Compare \ox{-1,\ch{O2^2-}} to \ch{"\ox{-1,O}" {}2^2-}
-\end{beispiel}
+\begin{example}
+ Compare \ox{-1,\ch{O2^2-}} to \ch{"\ox{-1,O}" {}2^2-}
+\end{example}
Sometimes one might want to use formal oxidation numbers like \num{.5} or
$\frac{1}{3}$:
-\begin{beispiel}
- \ox{.5,\ch{Br2}} \ch{"\ox{1/3,I}" {}3+}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ox{.5,\ch{Br2}} \ch{"\ox{1/3,I}" {}3+}
+\end{example}
-The fraction uses the \cmd*{sfrac} command of the \paket{xfrac} package. For
+The fraction uses the \cs*{sfrac} command of the \pkg{xfrac} package. For
this purpose the instance \code{chemmacros-ox-frac} is defined.
-\begin{beispiel}[code only]
-\DeclareInstance{xfrac}{chemmacros-ox-frac}{text}
- {
+\begin{sourcecode}
+ \DeclareInstance{xfrac}{chemmacros-ox-frac}{text}{
scale-factor = 1.2 ,
denominator-bot-sep = -.5ex ,
numerator-top-sep = -.3ex ,
@@ -1166,591 +1140,651 @@ this purpose the instance \code{chemmacros-ox-frac} is defined.
slash-right-kern = -.2em ,
slash-symbol-font = lmr
}
-\end{beispiel}
+\end{sourcecode}
Of course you can redefine it so that it suits your needs as the output often
strongly depends on the used font.
-\secidx*{Oxidation Numbers}
-\subsection{Partial Charges and Similar Stuff}\label{ssec:partialladungen}\secidx{Partial Charges}
+\subsection{Partial Charges and Similar Stuff}\label{ssec:partialladungen}
The next ones probably are seldomly needed but nevertheless useful:
-\begin{beschreibung}
- \Befehl{delp} \delp\ (\textbf{del}ta + \textbf{p}lus)
- \Befehl{delm} \delm\ (\textbf{del}ta + \textbf{m}inus)
- \Befehl{fdelp} \fdelp
- \Befehl{fdelm} \fdelm
-\end{beschreibung}
-
-These macros for example can be used with the \cmd{ox} command or with the
-\paket{chemfig} package:
-\begin{beispiel}
- \chemsetup{
- option/circled = all,
- ox/parse = false
- }
- \ce{\ox{\delp,H}-\ox{\delm,Cl}} \hspace*{1cm}
- \chemfig{\chemabove[3pt]{\lewis{246,Br}}{\delm}-\chemabove[3pt]{H}{\delp}}
-\end{beispiel}
-
-The following macros are useful together with \paket{chemfig}, too.
-\begin{beschreibung}
- \Befehl{scrp} \scrp\ (\textbf{scr}iptstyle + \textbf{p}lus)
- \Befehl{scrm} \scrm\ (\textbf{scr}iptstyle + \textbf{m}inus)
- \Befehl{fscrp} \fscrp
- \Befehl{fscrm} \fscrm
- \Befehl{fsscrp} \fsscrp\ (using \lstinline+\scriptscriptstyle+)
- \Befehl{fsscrm} \fsscrm
-\end{beschreibung}
-
-\begin{beispiel}
- \setatomsep{1.8em}\chemfig{CH_3-\chemabove{C}{\scrp}(-[6]C|H_3)-\vphantom{H_3}CH_3}
-
- \chemfig{\fmch{}|O-\chemabove{N}{\fscrp}(-[1]O|\fmch)-[7]O|\fmch}
-\end{beispiel}
-\secidx*{Partial Charges}
-
-\section{Reaction Mechanisms}\label{sec:mechanismen}\secidx{Reaction Mechanisms}
-
-With the command
-\begin{beschreibung}
- \Befehl{mech}[<type>]
-\end{beschreibung}
-one can specify the most common reaction mechanisms. \code{<type>} can have
-one of the following values:
-\begin{beschreibung}
- \Befehl{mech}\newline
- (empty, no opt. argument) nucleophilic substitution \mech
- \Befehl{mech}[1]\newline
- unimolecular nucleophilic substitution \mech[1]
- \Befehl{mech}[2]\newline
- bimolecular nucleophilic substitution \mech[2]
- \Befehl{mech}[se]\newline
- electrophilic substitution \mech[se]
- \Befehl{mech}[1e]\newline
- unimolecular electrophilic substitution \mech[1e]
- \Befehl{mech}[2e]\newline
- bimolecular electrophilic substitution \mech[2e]
- \Befehl{mech}[ar]\newline
- electrophilic aromatic substitution \mech[ar]
- \Befehl{mech}[e]\newline
- elimination \mech[e]
- \Befehl{mech}[e1]\newline
- unimolecular elimination \mech[e1]
- \Befehl{mech}[e2]\newline
- bimolecular elimination \mech[e2]
- \Befehl{mech}[cb]\newline
- unimolecular elimination \enquote{conjugated base}, \ie via carbanion
- \mech[cb]
-\end{beschreibung}
-\secidx*{Reaction Mechanisms}
-
-\section{Redox Reactions}\label{sec:redoxreaktionen}\secidx{Redox Reactions}% TODO: watch pagebreaks!
-
-\chemmacros provides two commands to visualize the transfer of electrons in
+\begin{commands}
+ \command{delp} \delp\ (\textbf{del}ta + \textbf{p}lus)
+ \command{delm} \delm\ (\textbf{del}ta + \textbf{m}inus)
+ \command{fdelp} \fdelp
+ \command{fdelm} \fdelm
+\end{commands}
+
+These macros for example can be used with the \cs{ox} command or with the
+\pkg{chemfig} package:
+\begin{example}
+ \chemsetup{
+ option/circled = all,
+ ox/parse = false
+ }
+ \ce{\ox{\delp,H}-\ox{\delm,Cl}} \hspace*{1cm}
+ \chemfig{\chemabove[3pt]{\lewis{246,Br}}{\delm}-\chemabove[3pt]{H}{\delp}}
+\end{example}
+
+The following macros are useful together with \pkg{chemfig}, too.
+\begin{commands}
+ \command{scrp} \scrp\ (\textbf{scr}iptstyle + \textbf{p}lus)
+ \command{scrm} \scrm\ (\textbf{scr}iptstyle + \textbf{m}inus)
+ \command{fscrp} \fscrp
+ \command{fscrm} \fscrm
+ \command{fsscrp} \fsscrp\ (using \cs*{scriptscriptstyle})
+ \command{fsscrm} \fsscrm
+\end{commands}
+
+\begin{example}
+ \setatomsep{1.8em}\chemfig{CH_3-\chemabove{C}{\scrp}(-[6]C|H_3)-\vphantom{H_3}CH_3}
+
+ \chemfig{\fmch{}|O-\chemabove{N}{\fscrp}(-[1]O|\fmch)-[7]O|\fmch}
+\end{example}
+
+\section{Reaction Mechanisms}\label{sec:mechanismen}
+
+\begin{commands}
+ \command{mech}[\oarg{type}]
+ Allows to specify the most common reaction mechanisms.
+\end{commands}
+\meta{type} can have one of the following values:
+\begin{commands}
+ \command{mech}
+ (empty, no opt. argument) nucleophilic substitution \mech
+ \command{mech}[\Oarg{1}]
+ unimolecular nucleophilic substitution \mech[1]
+ \command{mech}[\Oarg{2}]
+ bimolecular nucleophilic substitution \mech[2]
+ \command{mech}[\Oarg{se}]
+ electrophilic substitution \mech[se]
+ \command{mech}[\Oarg{1e}]
+ unimolecular electrophilic substitution \mech[1e]
+ \command{mech}[\Oarg{2e}]
+ bimolecular electrophilic substitution \mech[2e]
+ \command{mech}[\Oarg{ar}]
+ electrophilic aromatic substitution \mech[ar]
+ \command{mech}[\Oarg{e}]
+ elimination \mech[e]
+ \command{mech}[\Oarg{e1}]
+ unimolecular elimination \mech[e1]
+ \command{mech}[\Oarg{e2}]
+ bimolecular elimination \mech[e2]
+ \command{mech}[\Oarg{cb}]
+ unimolecular elimination \enquote{conjugated base}, \ie, via carbanion
+ \mech[cb]
+\end{commands}
+
+\section{Redox Reactions}\label{sec:redoxreaktionen}% TODO: watch pagebreaks!
+
+\chemmacros\ provides two commands to visualize the transfer of electrons in
redox reactions. Both commands are using \TikZ.
-\begin{beschreibung}
- \Befehl{OX}{<name>,<atom>}
- \Befehl{redox}(<name1>,<name2>)[<tikz>]\oa{<num>}{<text>}\newline
- Only the first argument \da{<name1>,<name2>} is required, the others are
- all optional.
-\end{beschreibung}
-
-\cmd{OX} places \code{<atom>} into a node, which is named with \code{<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 \code{remember picture,overlay}, the document needs to be
-\emph{compiled at least two times}.
-\begin{beispiel}[dist]
- \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b){oxidation}
-\end{beispiel}
-This line can be customized using \TikZ keys in \oa{<tikz>}:
-\begin{beispiel}[ox]
- \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
-\end{beispiel}
-
-With the argument \oa{<num>} the length of the vertical parts of the line can
+\begin{commands}
+ \command{OX}[\Marg{\meta{name},\meta{atom}}]
+ Label \meta{atom} with the label \meta{name}.
+ \command{redox}[\Darg{\meta{name1},\meta{name2}}\oarg{tikz}\oarg{num}\marg{text}]
+ Connect two \meta{atom}s previously labelled with \cs{OX}. Only the first
+ argument \Darg{\meta{name1},\meta{name2}} is required, the others are all
+ optional.
+\end{commands}
+
+\cs{OX} places \meta{atom} into a node, which is named with \meta{name}. If
+you have set two \cs{OX}, they can be connected with a line using \cs{redox}.
+To do so the names of the two nodes that are to be connected are written in
+the round braces. Since \cs{redox} draws a \code{tikzpicture} with options
+\code{remember picture,overlay}, the document needs to be \emph{compiled at
+ least two times}.
+
+\begin{example}
+ \vspace{7mm}
+ \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b){oxidation}
+\end{example}
+
+This line can be customized using \TikZ\ keys in \oarg{tikz}:
+\begin{example}
+ \vspace{7mm}
+ \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
+\end{example}
+
+With the argument \oarg{num} the length of the vertical parts of the line can
be adjusted. The default length is \code{.6em}. This length is multiplied
-with \code{<num>}. If you use a negative value the line is placed
-\emph{below} the text.
-\begin{beispiel}[dist]
- \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch
- \redox(a,b)[->,red]{ox}
- \redox(a,b)[<-,blue][-1]{red}
- \vspace{7mm}
-\end{beispiel}
+with \meta{num}. If you use a negative value the line is placed \emph{below}
+the text.
+\begin{example}
+ \vspace{7mm}
+ \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch
+ \redox(a,b)[->,red]{ox}
+ \redox(a,b)[<-,blue][-1]{red}
+ \vspace{7mm}
+\end{example}
+
The default length of the vertical lines can be customized with the option
-\begin{beschreibung}
- \Option[redox]{dist}{<dim>}\Default{.6em}
- A \TeX\ dimension.
-\end{beschreibung}
-\begin{beispiel}[dist]
- \chemsetup{redox/dist=1em}
- \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
-\end{beispiel}
-
-\begin{beschreibung}
- \Option[redox]{sep}{<dim>}\Default{.2em}
- The option can be used to change the distance between the atom and the
- beginning of the line.
-\end{beschreibung}
-
-\begin{beispiel}[dist]
- \chemsetup{redox/sep=.5em}
- \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
-\end{beispiel}
-
-\newpage
+\begin{options}
+ \keyval{dist}{dim}\Module{redox}\Default{.6em}
+ A \TeX\ dimension.
+\end{options}
+
+\begin{example}
+ \vspace{7mm}
+ \chemsetup{redox/dist=1em}
+ \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
+\end{example}
+
+\begin{options}
+ \keyval{sep}{dim}\Module{redox}\Default{.2em}
+ The option can be used to change the distance between the atom and the
+ beginning of the line.
+\end{options}
+
+\begin{example}
+ \vspace{7mm}
+ \chemsetup{redox/sep=.5em}
+ \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
+\end{example}
+
Examples:% TODO: watch pagebreaks!
-\begin{beispiel}[dist]
- \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$}
- \vspace{7mm}
-\end{beispiel}
-\begin{beispiel}[dist]
- \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$}
- \vspace{7mm}
-\end{beispiel}
-
-\bspmidlength{dist}{15mm}
-\begin{beispiel}[dist]
- \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}
-
-\bspmidlength{dist}{7mm}
- \begin{beispiel}[dist]
- \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}
- \vspace{7mm}
-\end{beispiel}
-\secidx*{Redox Reactions}
-
-\section{(Standard) State, Thermodynamics}\label{sec:standardstate}\secidx{Thermodynamics}
-\subsection{Thermodynamic Variables}\label{ssec:siunitx}
-
-The following commands use \paket{siunitx}:
-\begin{beschreibung}
- \Befehl{Enthalpy}[<keyval>]\da{<subscript>}\ma{<value>}
- \Befehl{Entropy}[<keyval>]\da{<subscript>}\ma{<value>}
- \Befehl{Gibbs}[<keyval>]\da{<subscript>}\ma{<value>}
-\end{beschreibung}
+\begin{example}
+ \vspace{7mm}
+ \ch{
+ 2 "\OX{o1,Na}" + "\OX{r1,Cl}" {}2
+ ->
+ 2 "\OX{o2,Na}" {}+ + 2 "\OX{r2,Cl}" {}-
+ }
+ \redox(o1,o2){\small OX: $- 2\el$}
+ \redox(r1,r2)[][-1]{\small RED: $+ 2\el$}
+ \vspace{7mm}
+\end{example}
+
+\begin{example}
+ \vspace{7mm}
+ \ch{
+ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
+ ->
+ 2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
+ }
+ \redox(o1,o2){\small OX: $- 2\el$}
+ \redox(r1,r2)[][-1]{\small RED: $+ 2\el$}
+ \vspace{7mm}
+\end{example}
+
+\begin{example}
+ \vspace{14mm}
+ \ch{
+ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
+ ->
+ 2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
+ }
+ \redox(o1,o2)[draw=red,->][3.33]{\small OX: $- 2\el$}
+ \redox(r1,r2)[draw=blue,->]{\small RED: $+ 2\el$}
+\end{example}
+
+\begin{example}
+ \vspace{7mm}
+ \ch{
+ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
+ -> 2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
+ }
+ \redox(o1,o2)[green,-stealth]{\small OX}
+ \redox(r1,r2)[purple,-stealth][-1]{\small RED}
+ \vspace{7mm}
+\end{example}
+
+\section{(Standard) State, Thermodynamics}\label{sec:stand-state-therm}
+\subsection{Thermodynamic Variables}\label{sec:therm-vari}
+
+The following commands use \pkg{siunitx}:
+\begin{commands}
+ \command{Enthalpy}[\oarg{options}\darg{subscript}\marg{value}]
+ Typeset the amount of enthalpy.
+ \command{Entropy}[\oarg{options}\darg{subscript}\marg{value}]
+ Typeset the amount of entropy.
+ \command{Gibbs}[\oarg{options}\darg{subscript}\marg{value}]
+ Typeset the amount of Gibbs enthalpy.
+\end{commands}
Their usage is pretty much self-explaining:
-\begin{beispiel}
- \Enthalpy{123} \\
- \Entropy{123} \\
+\begin{example}[side-by-side]
+ \Enthalpy{123} \par
+ \Entropy{123} \par
\Gibbs{123}
-\end{beispiel}
-The argument \da{<subscript>} adds a subscript for specification:
-\cmd{Enthalpy}(r){123} \Enthalpy(r){123}.
-
-There are several keys to customize the commands.
-\begin{beschreibung}
- \Option*{exponent}{<anything>}
- \Option*{delta}{<anything>|false}
- \Option*{subscript}{left|right}
- \Option*{unit}{<unit>}
-\end{beschreibung}
+\end{example}
+The argument \darg{subscript} adds a subscript for specification:
+\cs{Enthalpy}\Darg{r}\Marg{123} \Enthalpy(r){123}.
+
+There are several keys to customize the commands. They do not belong to a
+module and can only be used in the optional arguments of the commands.
+\begin{options}
+ \keyval{exponent}{anything}
+ Choose \meta{anything} as exponent.
+ \keychoice{delta}{\meta{anything},false}
+ Disable or choose a symbol in front of the main symbol. \meta{anything}
+ will be placed in math mode!
+ \keychoice{subscript}{left,right}
+ Choose if the subscript is placed to the left or the right of the main
+ symbol.
+ \keyval{unit}{unit}
+ Set the unit of the variable.
+\end{options}
The default values depend on the command.
-\begin{beispiel}
- \Enthalpy[unit=\kilo\joule]{-285} \\
- \Gibbs[delta=false]{0} \\
- \Entropy[delta=\Delta,exponent=]{56.7}
-\end{beispiel}
-The unit is set corresponding to the rules of \paket{siunitx} and depends on
+\begin{example}[side-by-side]
+ \Enthalpy[unit=\kilo\joule]{-285} \par
+ \Gibbs[delta=false]{0} \par
+ \Entropy[delta=\Delta,exponent=]{56.7}
+\end{example}
+The unit is set corresponding to the rules of \pkg{siunitx} and depends on
its settings:
-\begin{beispiel}
- \Enthalpy{-1234.56e3} \\
- \sisetup{per-mode=symbol,exponent-product=\cdot,output-decimal-marker={,},group-four-digits=true}
- \Enthalpy{-1234.56e3}
-\end{beispiel}
-
-\subsubsection{Create New Variables}
-
-You can use the command
-\begin{beschreibung}
- \Befehl{DeclareChemState}[<keyval>]{<name>}\ma{<symbol>}\ma{<unit>}
-\end{beschreibung}
-
-to create new corresponding commands:
-\begin{beispiel}
- \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}
-\end{beispiel}
-
-The command has some keys with which the default behaviour of the new command can
-be set.
-\begin{beschreibung}
- \Option*{exponent}{<anything>}
- \Option*{delta}{<anything>|false}
- \Option*{subscript-left}{\default{true}|false}
- \Option*{subscript}{<anything>}
-\end{beschreibung}
-
-\subsubsection{Redefine Variables}
-With
-\begin{beschreibung}
- \Befehl{RenewChemState}[<keyval>]{<name>}\ma{<symbol>}\ma{<unit>}
-\end{beschreibung}
-
-you can redefine the already existing commands:
-\begin{beispiel}
- \RenewChemState{Enthalpy}{h}{\joule}
- \Enthalpy(f){12.5}
-\end{beispiel}
-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}
- \DeclareChemState[exponent=]{enthalpy}{h}{\kilo\joule\per\mole}% molar
- \RenewChemState[exponent=]{Enthalpy}{H}{\kilo\joule}% absolute
- \enthalpy{-12.3} \Enthalpy{-12.3}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \Enthalpy{-1234.56e3} \par
+ \sisetup{
+ per-mode=symbol,
+ exponent-product=\cdot,
+ output-decimal-marker={,},
+ group-four-digits=true
+ }
+ \Enthalpy{-1234.56e3}
+\end{example}
+
+\subsubsection{Create New Variables or Redefine Existing Ones}\label{sec:create-new-variables}
+
+\begin{commands}
+ \command{DeclareChemState}[\marg{name}\oarg{options}\marg{symbol}\marg{unit}]
+ Define new corresponding commands. \meta{name} may either be a control
+ sequence token or a control sequence name without leading backslash.
+ \changedversion{4.2}This means that \cs{DeclareChemState}\Marg{name} and
+ \cs{DeclareChemState}\Marg{\cs*{name}} are equivalent. The reason for
+ this rather strange definition is a syntax change in \cs{DeclareChemState}
+ while retaining backwards compaitibility. The latter version is
+ recommended though and the former version may deprecate in the future.
+ \command{RenewChemState}[\marg{name}\oarg{options}\marg{symbol}\marg{unit}]
+ Redefine existing state commands. \meta{name} may either be a control
+ sequence token or a control sequence name without leading backslash.
+ \changedversion{4.2}This means that \cs{RenewChemState}\Marg{name} and
+ \cs{RenewChemState}\Marg{\cs*{name}} are equivalent. The reason for
+ this rather strange definition is a syntax change in \cs{RenewChemState}
+ while retaining backwards compaitibility. The latter version is
+ recommended though and the former version may deprecate in the future.
+\end{commands}
+
+\begin{example}
+ \DeclareChemState\Helmholtz{A}{\kilo\joule\per\mole}
+ \DeclareChemState\ElPot[subscript-left=false,exponent=]{E}{\volt}
+ \Helmholtz{123.4} \par
+ \ElPot{-1.1} \par
+ \ElPot[exponent=0]($\ch{Sn}|\ch{Sn^2+}||\ch{Pb^2+}|\ch{Pb}$){0.01}
+\end{example}
+
+The command has some keys with which the default behaviour of the new command
+can be set.
+\begin{options}
+ \keyval{exponent}{anything}\Default{\cs{standardstate}}
+ Set the default exponent.
+ \keychoice{delta}{\meta{anything},false}\Default{\cs{changestate}}
+ Choose the default ``delta'' symbol that is placed in front of the
+ main symbol. \meta{anything} will be placed in math mode!
+ \keybool{subscript-left}\Default{true}
+ Choose the default position of the sybscript.
+ \keyval{subscript}{anything}\Default
+ Choose the default subscript symbol.
+\end{options}
+
+\begin{example}[side-by-side]
+ \RenewChemState\Enthalpy{h}{\joule}
+ \Enthalpy(f){12.5}
+\end{example}
+
+The existing commands have been defined like this:
+\begin{sourcecode}
+ \DeclareChemState\Enthalpy{H}{\kilo\joule\per\mole}
+ \DeclareChemState\Entropy[delta=false,subscript-left=false]{S}
+ {\joule\per\kelvin\per\mole}
+ \DeclareChemState\Gibbs{G}{\kilo\joule\per\mole}
+\end{sourcecode}
+
+So -- for following thermodynamic conventions -- one could define a molar and
+an absolute variable:
+\begin{example}
+ \DeclareChemState\enthalpy[exponent=]{h}{\kilo\joule\per\mole}% molar
+ \RenewChemState\Enthalpy[exponent=]{H}{\kilo\joule}% absolute
+ \enthalpy{-12.3} \Enthalpy{-12.3}
+\end{example}
\subsection{State}\label{ssec:state}
-The commands presented in section~\ref{ssec:siunitx} internally all use the
-command\footnote{Please note that \ma{<subscript>} is an \emph{optional}
+The commands presented in section~\ref{sec:therm-vari} internally all use the
+command\footnote{Please note that \marg{subscript} is an \emph{optional}
argument.}
-\begin{beschreibung}
- \Befehl{State}[<keyval>]{<symbol>}\ma{<subscript>}
-\end{beschreibung}
+\begin{commands}
+ \command{State}[\oarg{options}\marg{symbol}\marg{subscript}]
+ Typeset a state variable.
+\end{commands}
-It can be used to write the thermodynamic variables without value and unit.
+It can be used to write the thermodynamic state variables without value and
+unit.
-Examples:
-\begin{beispiel}
- \State{A}, \State{G}{f}, \State[subscript-left=false]{E}{\ch{Na}}, \State[exponent=\SI{1000}{\celsius}]{H}
-\end{beispiel}
+\begin{example}
+ \State{A}, \State{G}{f},
+ \State[subscript-left=false]{E}{\ch{Na}},
+ \State[exponent=\SI{1000}{\celsius}]{H}
+\end{example}
Again there are some keys to customize the command:
-\begin{beschreibung}
- \Option[state]{exponent}{<anything>}
- \Option[state]{subscript-left}{\default{true}|false}
- \Option[state]{delta}{<anything>|false}
-\end{beschreibung}
-\secidx*{Thermodynamics}
-
-\section{Spectroscopy and Experimental Data}\label{sec:spektroskopie}\secidx{Spectroscopy}
-\subsection{The \cmd*{NMR} Command}
+\begin{options}
+ \keyval{exponent}{anything}\Module{state}
+ Set the default exponent symbol.
+ \keybool{subscript-left}\Module{state}
+ Set the default subscript position.
+ \keychoice{delta}{\meta{anything},false}\Module{state}
+ Set the default ``delta'' symbol. \meta{anything} will be placed in math
+ mode!
+\end{options}
+
+\section{Spectroscopy and Experimental Data}\label{sec:spektroskopie}
+\subsection{The \cs*{NMR} Command}
When you're trying to find out if a compound is the one you think it is often
NMR spectroscopy is used. The experimental data are typeset similar to this:
\begin{center}
- \NMR(400)[CDCl3] = \num{1.59}
+ \NMR(400)[CDCl3] = \num{1.59}
\end{center}
\chemmacros\ provides a command which simplifies the input (uses
-\paket{siunitx}).
+\pkg{siunitx}).
-\begin{beschreibung}
- \Befehl{NMR}*{<num>,<elem>}\da{<num>,<unit>}\oa{<solvent>}
-\end{beschreibung}
+\begin{commands}
+ \command{NMR}[\sarg\Marg{\meta{num},\meta{element}}%
+ \Darg{\meta{num},\meta{unit}}\oarg{solvent}]
+ Typeset nuclear magnetic resonance data.
+\end{commands}
\emph{All} Argument are optional! Without arguments we get:
-\begin{beispiel}
- \NMR \\
- \NMR*
-\end{beispiel}
+\begin{example}[side-by-side]
+ \NMR \par
+ \NMR*
+\end{example}
The first argument specifies the kind of NMR:
-\begin{beispiel}
- \NMR{13,C}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \NMR{13,C}
+\end{example}
The second argument sets the frequency (in \si{\mega\hertz}):
-\begin{beispiel}
- \NMR(400)
-\end{beispiel}
+\begin{example}[side-by-side]
+ \NMR(400)
+\end{example}
You can choose another unit:
-\begin{beispiel}
- \NMR(4e8,\hertz)
-\end{beispiel}
-Please note that the setup of \paket{siunitx} also affects this command:
-\begin{beispiel}
- \sisetup{exponent-product=\cdot}\NMR(4e8,\hertz)
-\end{beispiel}
+\begin{example}[side-by-side]
+ \NMR(4e8,\hertz)
+\end{example}
+Please note that the setup of \pkg{siunitx} also affects this command:
+\begin{example}[side-by-side]
+ \sisetup{exponent-product=\cdot}
+ \NMR(4e8,\hertz)
+\end{example}
The third argument specifies the solvent:
-\begin{beispiel}
- \NMR[CDCl3]
-\end{beispiel}
+\begin{example}[side-by-side]
+ \NMR[CDCl3]
+\end{example}
\subsection{Short Cuts}
It is possible to define short cut commands for specific nuclei.
-\begin{beschreibung}
- \Befehl{DeclareChemNMR}{<csname>}\ma{<num>,<atom>}
- \Befehl{RenewChemNMR}{<csname>}\ma{<num>,<atom>}
-\end{beschreibung}
-This defines a command with the same arguments as \cmd{NMR} \emph{except} for
-\ma{<num>,<atom>}.
-\begin{beispiel}
- \DeclareChemNMR\HNMR{1,H}%
- \DeclareChemNMR\CNMR{13,C}%
- \CNMR*(100) \\
- \HNMR*(400)
-\end{beispiel}
+\begin{commands}
+ \command{DeclareChemNMR}[\marg{cs}\Marg{\meta{num},\meta{atom}}]
+ Define a new shortcut macro for typesetting a certain type of magnetic
+ resonence data.
+ \command{RenewChemNMR}[\marg{cs}\Marg{\meta{num},\meta{atom}}]
+ Redefine an existing shortcut macro for typesetting a certain type of
+ magnetic resonence data.
+\end{commands}
+
+This defines a command with the same arguments as \cs{NMR} \emph{except} for
+\Marg{\meta{num},\meta{atom}}:
+\begin{example}[side-by-side]
+ \DeclareChemNMR\HNMR{1,H}%
+ \DeclareChemNMR\CNMR{13,C}%
+ \CNMR*(100) \par
+ \HNMR*(400)
+\end{example}
\subsection{An Environment to Typeset Experimental Data}
\chemmacros\ provides an environment to ease the input of experimental data.
-\begin{beschreibung}\catcode`\#=11
- \Umg{experimental}{data}\newline
- Environment for the output of experimental data. Inside the environment
- the following commands are defined.
- \Befehl{data}{<type>}\oa{<specification>}\newline
- Type of data, \eg\ IR, MS\ldots\ The optional argument takes further
- specifications which are output in parentheses.
- \Befehl{data}*{<type>}\oa{<specification>}\newline
- Like \cmd{data} but changes the \code{=} into a \code{:}, given that
- \key{use-equal}{true} is used.
- \Befehl{NMR}{<num>,<elem>\oa{<coupling core>}}\da{<num>,<unit>}\oa{<solvent>}\newline
- This command gets an additional argument: \cmd{NMR}{13,C[\textasciicircum
- 1H]} \NMR{13,C[^1H]}
- \Befehl{J}\da{<bonds>;<nuclei>}\oa{<unit>}\ma{<list of nums>}\newline
- Coupling constant, values are input separated by \code{;} (NMR). The
- argument \da{<bonds>;<nuclei>} is optional and enables further
- specifications of the coupling.
- \Befehl{#}{<num>}\newline
- Number of nuclei (NMR).
- \Befehl{pos}{<num>}\newline
- Position of nuclues (NMR).
- \Befehl{val}{<num>}\newline
- A number, an alias of \paket*{siunitx}' \cmd*{num}{<num>}.
- \Befehl{val}{<num1>-{}-<num2>}\newline
- An alias of \paket*{siunitx}' \cmd*{numrange}{<num1>}\ma{<num2>}.
-\end{beschreibung}
-
-\begin{beispiel}
- \begin{experimental}
- \data{type1} Data.
- \data{type2}[specifications] More data.
- \data*{type3} Even more data.
- \end{experimental}
-\end{beispiel}
+\begin{environments}
+ \environment{experimental}
+ Environment for the output of experimental data. Inside the environment
+ the following commands are defined.
+\end{environments}
+\begin{commands}
+ \command{data}[\marg{type}\oarg{specification}]
+ Type of data, \eg\ IR, MS\ldots\ The optional argument takes further
+ specifications which are output in parentheses.
+ \command{data}[\sarg\marg{type}\oarg{specification}]
+ Like \cs{data} but changes the \code{=} into a \code{:}, given that
+ \keyis{use-equal}{true} is used.
+ \command{NMR}[\Marg{\meta{num},\meta{elem}\oarg{coupling
+ core}}\Darg{\meta{num},\meta{unit}}\oarg{solvent}]
+ This command gets an additional argument:
+ \cs{NMR}\Marg{13,C[\textasciicircum 1H]} \NMR{13,C[^1H]}
+ \command{J}[\Darg{\meta{bonds};\meta{nuclei}}\oarg{unit}\marg{list of nums}]
+ Coupling constant, values are input separated by \code{;} (NMR). The
+ argument \Darg{\meta{bonds};\meta{nuclei}} is optional and enables further
+ specifications of the coupling.
+ \command{\#}[\marg{num}]
+ Number of nuclei (NMR).
+ \command{pos}[\marg{num}]
+ Position of nuclues (NMR).
+ \command{val}[\marg{num}]
+ A number, an alias of \pkg{siunitx}' \cs*{num}\marg{num}.
+ \command{val}[\Marg{\meta{num1}--\meta{num2}}]
+ An alias of \pkg{siunitx}' \cs*{numrange}\marg{num1}\marg{num2}.
+\end{commands}
+
+\begin{example}
+ \begin{experimental}
+ \data{type1} Data.
+ \data{type2}[specifications] More data.
+ \data*{type3} Even more data.
+ \end{experimental}
+\end{example}
\subsection{Customization}
The output of the environment and of the NMR commands can be customized be a
number of options. For historical reasons they all belong to the module
-\textcolor{module}{\code{nmr}}.
-\begin{beschreibung}
- \Option[nmr]{unit}{<unit>}\Default{\cmd*{mega}\cmd*{hertz}}
- The used default unit.
- \Option[nmr]{nucleus}{\{<num>,<atom>\}}\Default{\ma{1,H}}
- The used default nucleus.
- \Option[nmr]{format}{<commands>}\Default{}
- For example \cmd*{bfseries}.
- \Option[nmr]{pos-number}{side|sub}\Default{side}
- Position of the number next to the atom.
- \Option[nmr]{coupling-unit}{<unit>}\Default{\cmd*{hertz}}
- A \paket{siunitx} unit.
- \Option[nmr]{parse}{\default{true}|false}\Default{true}
- Treat the solvent as \chemformula\ formula or not.
- \Option[nmr]{delta}{<tokens>}\Default{}
- The \code{<tokens>} are added after $\delta$.
- \Option[nmr]{list}{\default{true}|false}\Default{false}
- The environment \env{nmr}[<optionen>]{} is formatted as a list
- \Option[nmr]{list-setup}{<setup>}\newline
- Setup of the list. See below for the default settings.
- \Option[nmr]{use-equal}{\default{true}|false}\Default{false}
- Add egual sign after \cmd{NMR} and \cmd{data}.
-\end{beschreibung}
+\module{nmr}.
+\begin{options}
+ \keyval{unit}{unit}\Module{nmr}\Default{\cs*{mega}\cs*{hertz}}
+ The used default unit.
+ \keychoice{nucleus}{\Marg{\meta{num},\meta{atom}}}\Module{nmr}\Default{\Marg{1,H}}
+ The used default nucleus.
+ \keyval{format}{commands}\Module{nmr}\Default
+ For example \cs*{bfseries}.
+ \keychoice{pos-number}{side,sub}\Module{nmr}\Default{side}
+ Position of the number next to the atom.
+ \keyval{coupling-unit}{unit}\Module{nmr}\Default{\cs*{hertz}}
+ A \pkg{siunitx} unit.
+ \keybool{parse}\Module{nmr}\Default{true}
+ Treat the solvent as \chemformula\ formula or not.
+ \keyval{delta}{tokens}\Module{nmr}\Default
+ The \meta{tokens} are added after $\delta$.
+ \keybool{list}\Module{nmr}\Default{false}
+ The environment \env{nmr}[<optionen>]{} is formatted as a list
+ \keyval{list-setup}{setup}\Module{nmr}
+ Setup of the list. See below for the default settings.
+ \keybool{use-equal}\Module{nmr}\Default{false}
+ Add egual sign after \cs{NMR} and \cs{data}.
+\end{options}
The default setup of the list:
-\begin{beispiel}[code only]
- \topsep\z@skip \partopsep\z@skip
- \itemsep\z@ \parsep\z@ \itemindent\z@
- \leftmargin\z@
-\end{beispiel}
-
-\begin{beispiel}
- \begin{experimental}[format=\bfseries]
- \data{type1} Data.
- \data{type2}[specifications] More data.
- \data*{type3} Even more data.
- \end{experimental}
-\end{beispiel}
-
-The command \cmd{NMR} and all commands defined through \cmd{DeclareChemNMR}
-can be used like \cmd{data} for the NMR data.
-
-\begin{beispiel}
- \begin{experimental}[format=\bfseries,use-equal]
- \data{type1} Data.
- \data{type2}[specifications] More data.
- \NMR Even more data.
- \end{experimental}
-\end{beispiel}
+\begin{sourcecode}
+ \topsep\z@skip \partopsep\z@skip
+ \itemsep\z@ \parsep\z@ \itemindent\z@
+ \leftmargin\z@
+\end{sourcecode}
+
+\begin{example}
+ \begin{experimental}[format=\bfseries]
+ \data{type1} Data.
+ \data{type2}[specifications] More data.
+ \data*{type3} Even more data.
+ \end{experimental}
+\end{example}
+
+The command \cs{NMR} and all commands defined through \cs{DeclareChemNMR}
+can be used like \cs{data} for the NMR data.
+
+\begin{example}
+ \begin{experimental}[format=\bfseries,use-equal]
+ \data{type1} Data.
+ \data{type2}[specifications] More data.
+ \NMR Even more data.
+ \end{experimental}
+\end{example}
\subsection{An Example}
-The code below is shown with different specifications for \code{<optionen>}.
-Of course options can also be chosen with \cmd{chemsetup}.
-
-\begin{beispiel}[code only]
-\sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}
-\begin{experimental}[<optionen>]
- \data*{yield} \SI{17}{\milli\gram} yellow needles (\SI{0.04}{\milli\mole}, \SI{13}{\percent}).
- %
- \data{mp.} \SI{277}{\celsius} (DSC).
- %
- \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},
- \pos{1}), \val{6.72--6.74} (m, \#{2}, \pos{11}), \val{6.82} (s, \#{8},
- \pos{3}), \val{7.05--7.07} (m, \#{2}, \pos{12}), \val{7.39--7.41} (m, \#{4},
- \pos{9}), \val{7.48--7.49} (m, \#{4}, \pos{8}).
- %
- \NMR{13,C}(150)[CDCl3] \val{21.2} ($+$, \#{4}, \pos{1}), \val{23.4} ($+$,
- \#{8}, \pos{5}), \val{126.0} ($+$, \#{4}, \pos{9}), \val{128.2} ($+$, \#{8},
- \pos{3}), \val{130.8} ($+$, \#{2}, \pos{12}), \val{133.6} ($+$, \#{2},
- \pos{11}), \val{137.0} ($+$, \#{4}, \pos{8}), \val{138.6} (q, \#{4},
- \pos{2}), \val{140.6} (q, \#{2}, \pos{10}), \val{140.8} (q, \#{8}, \pos{4}),
- \val{141.8} (q, \#{4}, \pos{6}), \val{145.6} (q, \#{2}, \pos{7}).
- %
- \data{MS}[DCP, EI, \SI{60}{\electronvolt}] \val{703} (2, \ch{M+}), \val{582}
- (1), \val{462} (1), \val{249} (13), \val{120} (41), \val{105} (100).
- %
- \data{MS}[\ch{MeOH + H2O + KI}, ESI, \SI{10}{\electronvolt}] \val{720} (100,
- \ch{M+ + OH-}), \val{368} (\ch{M+ + 2 OH-}).
- %
- \data{IR}[KBr] \val{3443} (w), \val{3061} (w), \val{2957} (m), \val{2918}
- (m), \val{2856} (w), \val{2729} (w), \val{1725} (w), \val{1606} (s),
- \val{1592} (s), \val{1545} (w), \val{1446} (m), \val{1421} (m), \val{1402}
- (m), \val{1357} (w), \val{1278} (w), \val{1238} (s), \val{1214} (s),
- \val{1172} (s), \val{1154} (m), \val{1101} (w), \val{1030} (w), \val{979}
- (m), \val{874} (m), \val{846} (s), \val{818} (w), \val{798} (m), \val{744}
- (w), \val{724} (m), \val{663} (w), \val{586} (w), \val{562} (w), \val{515}
- (w).
- %
- \data*{UV-Vis} \SI{386}{\nano\metre} ($\varepsilon = \val{65984}$),
- \SI{406}{\nano\metre} ($\varepsilon = \val{65378}$).
- %
- \data*{quantum yield} $\Phi = \val{0.74+-0.1}$\,.
-\end{experimental}
-\end{beispiel}
+The code below is shown with different specifications for \meta{options}.
+Of course options can also be chosen with \cs{chemsetup}.
+
+\begin{sourcecode}
+ \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}
+ \begin{experimental}[<optionen>]
+ \data*{yield} \SI{17}{\milli\gram} yellow needles (\SI{0.04}{\milli\mole},
+ \SI{13}{\percent}).
+ %
+ \data{mp.} \SI{277}{\celsius} (DSC).
+ %
+ \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},
+ \pos{1}), \val{6.72--6.74} (m, \#{2}, \pos{11}), \val{6.82} (s, \#{8},
+ \pos{3}), \val{7.05--7.07} (m, \#{2}, \pos{12}), \val{7.39--7.41} (m, \#{4},
+ \pos{9}), \val{7.48--7.49} (m, \#{4}, \pos{8}).
+ %
+ \NMR{13,C}(150)[CDCl3] \val{21.2} ($+$, \#{4}, \pos{1}), \val{23.4} ($+$,
+ \#{8}, \pos{5}), \val{126.0} ($+$, \#{4}, \pos{9}), \val{128.2} ($+$, \#{8},
+ \pos{3}), \val{130.8} ($+$, \#{2}, \pos{12}), \val{133.6} ($+$, \#{2},
+ \pos{11}), \val{137.0} ($+$, \#{4}, \pos{8}), \val{138.6} (q, \#{4},
+ \pos{2}), \val{140.6} (q, \#{2}, \pos{10}), \val{140.8} (q, \#{8}, \pos{4}),
+ \val{141.8} (q, \#{4}, \pos{6}), \val{145.6} (q, \#{2}, \pos{7}).
+ %
+ \data{MS}[DCP, EI, \SI{60}{\electronvolt}] \val{703} (2, \ch{M+}), \val{582}
+ (1), \val{462} (1), \val{249} (13), \val{120} (41), \val{105} (100).
+ %
+ \data{MS}[\ch{MeOH + H2O + KI}, ESI, \SI{10}{\electronvolt}] \val{720} (100,
+ \ch{M+ + OH-}), \val{368} (\ch{M+ + 2 OH-}).
+ %
+ \data{IR}[KBr] \val{3443} (w), \val{3061} (w), \val{2957} (m), \val{2918}
+ (m), \val{2856} (w), \val{2729} (w), \val{1725} (w), \val{1606} (s),
+ \val{1592} (s), \val{1545} (w), \val{1446} (m), \val{1421} (m), \val{1402}
+ (m), \val{1357} (w), \val{1278} (w), \val{1238} (s), \val{1214} (s),
+ \val{1172} (s), \val{1154} (m), \val{1101} (w), \val{1030} (w), \val{979}
+ (m), \val{874} (m), \val{846} (s), \val{818} (w), \val{798} (m), \val{744}
+ (w), \val{724} (m), \val{663} (w), \val{586} (w), \val{562} (w), \val{515}
+ (w).
+ %
+ \data*{UV-Vis} \SI{386}{\nano\metre} ($\varepsilon = \val{65984}$),
+ \SI{406}{\nano\metre} ($\varepsilon = \val{65378}$).
+ %
+ \data*{quantum yield} $\Phi = \val{0.74+-0.1}$\,.
+ \end{experimental}
+\end{sourcecode}
\subsubsection{Nearly Standard}
Output with these options:
-\lstinline+<optionen>: delta=(ppm),pos-number=sub,use-equal+
-
-\bigskip
+\begin{sourcecode}
+ delta=(ppm),pos-number=sub,use-equal
+\end{sourcecode}
\begin{experimental}[delta=(ppm),pos-number=sub,use-equal]
- \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}
- \chemsetup[chemformula]{
- font-spec =
- {[Numbers={Proportional,Lining}]Linux Libertine O}
- }
- %
- \data*{yield} \SI{17}{\milli\gram} yellow needles (\SI{0.04}{\milli\mole},
- \SI{13}{\percent}).
- %
- \data{mp.} \SI{277}{\celsius} (DSC).
- %
- \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},
- \pos{1}), \val{6.72--6.74} (m, \#{2}, \pos{11}), \val{6.82} (s, \#{8},
- \pos{3}), \val{7.05--7.07} (m, \#{2}, \pos{12}), \val{7.39--7.41} (m, \#{4},
- \pos{9}), \val{7.48--7.49} (m, \#{4}, \pos{8}).
- %
- \NMR{13,C}(150)[CDCl3] \val{21.2} ($+$, \#{4}, \pos{1}), \val{23.4} ($+$,
- \#{8}, \pos{5}), \val{126.0} ($+$, \#{4}, \pos{9}), \val{128.2} ($+$, \#{8},
- \pos{3}), \val{130.8} ($+$, \#{2}, \pos{12}), \val{133.6} ($+$, \#{2},
- \pos{11}), \val{137.0} ($+$, \#{4}, \pos{8}), \val{138.6} (q, \#{4},
- \pos{2}), \val{140.6} (q, \#{2}, \pos{10}), \val{140.8} (q, \#{8}, \pos{4}),
- \val{141.8} (q, \#{4}, \pos{6}), \val{145.6} (q, \#{2}, \pos{7}).
- %
- \data{MS}[DCP, EI, \SI{60}{\electronvolt}] \val{703} (2, \ch{M+}), \val{582}
- (1), \val{462} (1), \val{249} (13), \val{120} (41), \val{105} (100).
- %
- \data{MS}[\ch{MeOH + H2O + KI}, ESI, \SI{10}{\electronvolt}] \val{720} (100,
- \ch{M+ + OH-}), \val{368} (\ch{M+ + 2 OH-}).
- %
- \data{IR}[KBr] \val{3443} (w), \val{3061} (w), \val{2957} (m), \val{2918}
- (m), \val{2856} (w), \val{2729} (w), \val{1725} (w), \val{1606} (s),
- \val{1592} (s), \val{1545} (w), \val{1446} (m), \val{1421} (m), \val{1402}
- (m), \val{1357} (w), \val{1278} (w), \val{1238} (s), \val{1214} (s),
- \val{1172} (s), \val{1154} (m), \val{1101} (w), \val{1030} (w), \val{979}
- (m), \val{874} (m), \val{846} (s), \val{818} (w), \val{798} (m), \val{744}
- (w), \val{724} (m), \val{663} (w), \val{586} (w), \val{562} (w), \val{515}
- (w).
- %
- \data*{UV-Vis} \SI{386}{\nano\metre} ($\varepsilon = \val{65984}$),
- \SI{406}{\nano\metre} ($\varepsilon = \val{65378}$).
- %
- \data*{quantum yield} $\Phi = \val{0.74+-0.1}$\,.
+ \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}
+ \data*{yield} \SI{17}{\milli\gram} yellow needles (\SI{0.04}{\milli\mole},
+ \SI{13}{\percent}).
+ %
+ \data{mp.} \SI{277}{\celsius} (DSC).
+ %
+ \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},
+ \pos{1}), \val{6.72--6.74} (m, \#{2}, \pos{11}), \val{6.82} (s, \#{8},
+ \pos{3}), \val{7.05--7.07} (m, \#{2}, \pos{12}), \val{7.39--7.41} (m, \#{4},
+ \pos{9}), \val{7.48--7.49} (m, \#{4}, \pos{8}).
+ %
+ \NMR{13,C}(150)[CDCl3] \val{21.2} ($+$, \#{4}, \pos{1}), \val{23.4} ($+$,
+ \#{8}, \pos{5}), \val{126.0} ($+$, \#{4}, \pos{9}), \val{128.2} ($+$, \#{8},
+ \pos{3}), \val{130.8} ($+$, \#{2}, \pos{12}), \val{133.6} ($+$, \#{2},
+ \pos{11}), \val{137.0} ($+$, \#{4}, \pos{8}), \val{138.6} (q, \#{4},
+ \pos{2}), \val{140.6} (q, \#{2}, \pos{10}), \val{140.8} (q, \#{8}, \pos{4}),
+ \val{141.8} (q, \#{4}, \pos{6}), \val{145.6} (q, \#{2}, \pos{7}).
+ %
+ \data{MS}[DCP, EI, \SI{60}{\electronvolt}] \val{703} (2, \ch{M+}), \val{582}
+ (1), \val{462} (1), \val{249} (13), \val{120} (41), \val{105} (100).
+ %
+ \data{MS}[\ch{MeOH + H2O + KI}, ESI, \SI{10}{\electronvolt}] \val{720} (100,
+ \ch{M+ + OH-}), \val{368} (\ch{M+ + 2 OH-}).
+ %
+ \data{IR}[KBr] \val{3443} (w), \val{3061} (w), \val{2957} (m), \val{2918}
+ (m), \val{2856} (w), \val{2729} (w), \val{1725} (w), \val{1606} (s),
+ \val{1592} (s), \val{1545} (w), \val{1446} (m), \val{1421} (m), \val{1402}
+ (m), \val{1357} (w), \val{1278} (w), \val{1238} (s), \val{1214} (s),
+ \val{1172} (s), \val{1154} (m), \val{1101} (w), \val{1030} (w), \val{979}
+ (m), \val{874} (m), \val{846} (s), \val{818} (w), \val{798} (m), \val{744}
+ (w), \val{724} (m), \val{663} (w), \val{586} (w), \val{562} (w), \val{515}
+ (w).
+ %
+ \data*{UV-Vis} \SI{386}{\nano\metre} ($\varepsilon = \val{65984}$),
+ \SI{406}{\nano\metre} ($\varepsilon = \val{65378}$).
+ %
+ \data*{quantum yield} $\Phi = \val{0.74+-0.1}$\,.
\end{experimental}
\subsubsection{Formatted List}
Output with these options:
-\lstinline+<optionen>: format=\bfseries,delta=(ppm),list=true,use-equal+
-
-\bigskip
+\begin{sourcecode}
+ format=\bfseries,delta=(ppm),list=true,use-equal
+\end{sourcecode}
\begin{experimental}[format=\bfseries,delta=(ppm),list=true,use-equal]
- \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}
- \chemsetup[chemformula]{
- font-spec =
- {[Numbers={Proportional,Lining}]Linux Libertine O}
- }
- %
- \data*{yield} \SI{17}{\milli\gram} yellow needles (\SI{0.04}{\milli\mole},
- \SI{13}{\percent}).
- %
- \data{mp.} \SI{277}{\celsius} (DSC).
- %
- \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},
- \pos{1}), \val{6.72--6.74} (m, \#{2}, \pos{11}), \val{6.82} (s, \#{8},
- \pos{3}), \val{7.05--7.07} (m, \#{2}, \pos{12}), \val{7.39--7.41} (m, \#{4},
- \pos{9}), \val{7.48--7.49} (m, \#{4}, \pos{8}).
- %
- \NMR{13,C}(150)[CDCl3] \val{21.2} ($+$, \#{4}, \pos{1}), \val{23.4} ($+$,
- \#{8}, \pos{5}), \val{126.0} ($+$, \#{4}, \pos{9}), \val{128.2} ($+$, \#{8},
- \pos{3}), \val{130.8} ($+$, \#{2}, \pos{12}), \val{133.6} ($+$, \#{2},
- \pos{11}), \val{137.0} ($+$, \#{4}, \pos{8}), \val{138.6} (q, \#{4},
- \pos{2}), \val{140.6} (q, \#{2}, \pos{10}), \val{140.8} (q, \#{8}, \pos{4}),
- \val{141.8} (q, \#{4}, \pos{6}), \val{145.6} (q, \#{2}, \pos{7}).
- %
- \data{MS}[DCP, EI, \SI{60}{\electronvolt}] \val{703} (2, \ch{M+}), \val{582}
- (1), \val{462} (1), \val{249} (13), \val{120} (41), \val{105} (100).
- %
- \data{MS}[\ch{MeOH + H2O + KI}, ESI, \SI{10}{\electronvolt}] \val{720} (100,
- \ch{M+ + OH-}), \val{368} (\ch{M+ + 2 OH-}).
- %
- \data{IR}[KBr] \val{3443} (w), \val{3061} (w), \val{2957} (m), \val{2918}
- (m), \val{2856} (w), \val{2729} (w), \val{1725} (w), \val{1606} (s),
- \val{1592} (s), \val{1545} (w), \val{1446} (m), \val{1421} (m), \val{1402}
- (m), \val{1357} (w), \val{1278} (w), \val{1238} (s), \val{1214} (s),
- \val{1172} (s), \val{1154} (m), \val{1101} (w), \val{1030} (w), \val{979}
- (m), \val{874} (m), \val{846} (s), \val{818} (w), \val{798} (m), \val{744}
- (w), \val{724} (m), \val{663} (w), \val{586} (w), \val{562} (w), \val{515}
- (w).
- %
- \data*{UV-Vis} \SI{386}{\nano\metre} ($\varepsilon = \val{65984}$),
- \SI{406}{\nano\metre} ($\varepsilon = \val{65378}$).
- %
- \data*{quantum yield} $\Phi = \val{0.74+-0.1}$\,.
+ \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}
+ \data*{yield} \SI{17}{\milli\gram} yellow needles (\SI{0.04}{\milli\mole},
+ \SI{13}{\percent}).
+ %
+ \data{mp.} \SI{277}{\celsius} (DSC).
+ %
+ \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},
+ \pos{1}), \val{6.72--6.74} (m, \#{2}, \pos{11}), \val{6.82} (s, \#{8},
+ \pos{3}), \val{7.05--7.07} (m, \#{2}, \pos{12}), \val{7.39--7.41} (m, \#{4},
+ \pos{9}), \val{7.48--7.49} (m, \#{4}, \pos{8}).
+ %
+ \NMR{13,C}(150)[CDCl3] \val{21.2} ($+$, \#{4}, \pos{1}), \val{23.4} ($+$,
+ \#{8}, \pos{5}), \val{126.0} ($+$, \#{4}, \pos{9}), \val{128.2} ($+$, \#{8},
+ \pos{3}), \val{130.8} ($+$, \#{2}, \pos{12}), \val{133.6} ($+$, \#{2},
+ \pos{11}), \val{137.0} ($+$, \#{4}, \pos{8}), \val{138.6} (q, \#{4},
+ \pos{2}), \val{140.6} (q, \#{2}, \pos{10}), \val{140.8} (q, \#{8}, \pos{4}),
+ \val{141.8} (q, \#{4}, \pos{6}), \val{145.6} (q, \#{2}, \pos{7}).
+ %
+ \data{MS}[DCP, EI, \SI{60}{\electronvolt}] \val{703} (2, \ch{M+}), \val{582}
+ (1), \val{462} (1), \val{249} (13), \val{120} (41), \val{105} (100).
+ %
+ \data{MS}[\ch{MeOH + H2O + KI}, ESI, \SI{10}{\electronvolt}] \val{720} (100,
+ \ch{M+ + OH-}), \val{368} (\ch{M+ + 2 OH-}).
+ %
+ \data{IR}[KBr] \val{3443} (w), \val{3061} (w), \val{2957} (m), \val{2918}
+ (m), \val{2856} (w), \val{2729} (w), \val{1725} (w), \val{1606} (s),
+ \val{1592} (s), \val{1545} (w), \val{1446} (m), \val{1421} (m), \val{1402}
+ (m), \val{1357} (w), \val{1278} (w), \val{1238} (s), \val{1214} (s),
+ \val{1172} (s), \val{1154} (m), \val{1101} (w), \val{1030} (w), \val{979}
+ (m), \val{874} (m), \val{846} (s), \val{818} (w), \val{798} (m), \val{744}
+ (w), \val{724} (m), \val{663} (w), \val{586} (w), \val{562} (w), \val{515}
+ (w).
+ %
+ \data*{UV-Vis} \SI{386}{\nano\metre} ($\varepsilon = \val{65984}$),
+ \SI{406}{\nano\metre} ($\varepsilon = \val{65378}$).
+ %
+ \data*{quantum yield} $\Phi = \val{0.74+-0.1}$\,.
\end{experimental}
\subsubsection{Crazy}
-Output for these options: \code{<optionen>}:
-\begin{lstlisting}
+Output for these options:
+\begin{sourcecode}
format=\color{red}\itshape,
list=true,
delta=\textcolor{green}{\ch{M+ + H2O}},
@@ -1758,502 +1792,544 @@ Output for these options: \code{<optionen>}:
coupling-unit=\mega\gram\per\square\second,
list-setup=,
use-equal
-\end{lstlisting}
+\end{sourcecode}
\begin{experimental}[
- format=\color{red}\itshape,
- list=true,
- delta=\textcolor{green}{\ch{M+ + H2O}},
- pos-number=side,
- coupling-unit=\mega\gram\per\square\second,
- list-setup=,use-equal]
- \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}
- \chemsetup[chemformula]{
- font-spec =
- {[Numbers={Proportional,Lining}]Linux Libertine O}
- }
- %
- \data*{yield} \SI{17}{\milli\gram} yellow needles (\SI{0.04}{\milli\mole},
- \SI{13}{\percent}).
- %
- \data{mp.} \SI{277}{\celsius} (DSC).
- %
- \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},
- \pos{1}), \val{6.72--6.74} (m, \#{2}, \pos{11}), \val{6.82} (s, \#{8},
- \pos{3}), \val{7.05--7.07} (m, \#{2}, \pos{12}), \val{7.39--7.41} (m, \#{4},
- \pos{9}), \val{7.48--7.49} (m, \#{4}, \pos{8}).
- %
- \NMR{13,C}(150)[CDCl3] \val{21.2} ($+$, \#{4}, \pos{1}), \val{23.4} ($+$,
- \#{8}, \pos{5}), \val{126.0} ($+$, \#{4}, \pos{9}), \val{128.2} ($+$, \#{8},
- \pos{3}), \val{130.8} ($+$, \#{2}, \pos{12}), \val{133.6} ($+$, \#{2},
- \pos{11}), \val{137.0} ($+$, \#{4}, \pos{8}), \val{138.6} (q, \#{4},
- \pos{2}), \val{140.6} (q, \#{2}, \pos{10}), \val{140.8} (q, \#{8}, \pos{4}),
- \val{141.8} (q, \#{4}, \pos{6}), \val{145.6} (q, \#{2}, \pos{7}).
- %
- \data{MS}[DCP, EI, \SI{60}{\electronvolt}] \val{703} (2, \ch{M+}), \val{582}
- (1), \val{462} (1), \val{249} (13), \val{120} (41), \val{105} (100).
- %
- \data{MS}[\ch{MeOH + H2O + KI}, ESI, \SI{10}{\electronvolt}] \val{720} (100,
- \ch{M+ + OH-}), \val{368} (\ch{M+ + 2 OH-}).
- %
- \data{IR}[KBr] \val{3443} (w), \val{3061} (w), \val{2957} (m), \val{2918}
- (m), \val{2856} (w), \val{2729} (w), \val{1725} (w), \val{1606} (s),
- \val{1592} (s), \val{1545} (w), \val{1446} (m), \val{1421} (m), \val{1402}
- (m), \val{1357} (w), \val{1278} (w), \val{1238} (s), \val{1214} (s),
- \val{1172} (s), \val{1154} (m), \val{1101} (w), \val{1030} (w), \val{979}
- (m), \val{874} (m), \val{846} (s), \val{818} (w), \val{798} (m), \val{744}
- (w), \val{724} (m), \val{663} (w), \val{586} (w), \val{562} (w), \val{515}
- (w).
- %
- \data*{UV-Vis} \SI{386}{\nano\metre} ($\varepsilon = \val{65984}$),
- \SI{406}{\nano\metre} ($\varepsilon = \val{65378}$).
- %
- \data*{quantum yield} $\Phi = \val{0.74+-0.1}$\,.
+ format=\color{red}\itshape,
+ list=true,
+ delta=\textcolor{green}{\ch{M+ + H2O}},
+ pos-number=side,
+ coupling-unit=\mega\gram\per\square\second,
+ list-setup=,use-equal]
+ \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}
+ \data*{yield} \SI{17}{\milli\gram} yellow needles (\SI{0.04}{\milli\mole},
+ \SI{13}{\percent}).
+ %
+ \data{mp.} \SI{277}{\celsius} (DSC).
+ %
+ \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},
+ \pos{1}), \val{6.72--6.74} (m, \#{2}, \pos{11}), \val{6.82} (s, \#{8},
+ \pos{3}), \val{7.05--7.07} (m, \#{2}, \pos{12}), \val{7.39--7.41} (m, \#{4},
+ \pos{9}), \val{7.48--7.49} (m, \#{4}, \pos{8}).
+ %
+ \NMR{13,C}(150)[CDCl3] \val{21.2} ($+$, \#{4}, \pos{1}), \val{23.4} ($+$,
+ \#{8}, \pos{5}), \val{126.0} ($+$, \#{4}, \pos{9}), \val{128.2} ($+$, \#{8},
+ \pos{3}), \val{130.8} ($+$, \#{2}, \pos{12}), \val{133.6} ($+$, \#{2},
+ \pos{11}), \val{137.0} ($+$, \#{4}, \pos{8}), \val{138.6} (q, \#{4},
+ \pos{2}), \val{140.6} (q, \#{2}, \pos{10}), \val{140.8} (q, \#{8}, \pos{4}),
+ \val{141.8} (q, \#{4}, \pos{6}), \val{145.6} (q, \#{2}, \pos{7}).
+ %
+ \data{MS}[DCP, EI, \SI{60}{\electronvolt}] \val{703} (2, \ch{M+}), \val{582}
+ (1), \val{462} (1), \val{249} (13), \val{120} (41), \val{105} (100).
+ %
+ \data{MS}[\ch{MeOH + H2O + KI}, ESI, \SI{10}{\electronvolt}] \val{720} (100,
+ \ch{M+ + OH-}), \val{368} (\ch{M+ + 2 OH-}).
+ %
+ \data{IR}[KBr] \val{3443} (w), \val{3061} (w), \val{2957} (m), \val{2918}
+ (m), \val{2856} (w), \val{2729} (w), \val{1725} (w), \val{1606} (s),
+ \val{1592} (s), \val{1545} (w), \val{1446} (m), \val{1421} (m), \val{1402}
+ (m), \val{1357} (w), \val{1278} (w), \val{1238} (s), \val{1214} (s),
+ \val{1172} (s), \val{1154} (m), \val{1101} (w), \val{1030} (w), \val{979}
+ (m), \val{874} (m), \val{846} (s), \val{818} (w), \val{798} (m), \val{744}
+ (w), \val{724} (m), \val{663} (w), \val{586} (w), \val{562} (w), \val{515}
+ (w).
+ %
+ \data*{UV-Vis} \SI{386}{\nano\metre} ($\varepsilon = \val{65984}$),
+ \SI{406}{\nano\metre} ($\varepsilon = \val{65378}$).
+ %
+ \data*{quantum yield} $\Phi = \val{0.74+-0.1}$\,.
\end{experimental}
-\secidx*{Spectroscopy}
-\section{Commands for \textsf{mhchem}}\label{sec:mhchem}\secidx{Commands for mhchem}
+\section{Commands for \pkg*{mhchem}}\label{sec:mhchem}
-\paket{mhchem} is not officially supported by \chemmacros\ as it used
+\pkg{mhchem} is not officially supported by \chemmacros\ as it used
\chemformula\ instead. However, for historical reasons the following command
is still provided.
-\begin{beschreibung}
- \Befehl{mhName}[<keyval>]{<formula>}\ma{<text>}
-\end{beschreibung}
+\begin{commands}
+ \command{mhName}[\oarg{options}\marg{formula}\marg{text}]
+ Writes \meta{text} below \meta{formula}
+\end{commands}
For example:
-\begin{beispiel}
- \ce{4 C2H5Cl + Pb{/}Na -> \mhName{Pb(C2H5)4}{former antiknock additive} + NaCl}
-\end{beispiel}
-
-There are several keys to customize \cmd{mhName}.
-\begin{beschreibung}
- \Option[mhName]{align}{<alignment command>}\Default{\cmd*{centering}}
- The alignment of the text in the box it is placed in.
- \Option[mhName]{format}{<anything>}\Default{}
- The format of the text.
- \Option[mhName]{fontsize}{<font size command>}\Default{\cmd*{tiny}}
- The fontsize of the text.
- \Option[mhName]{width}{<dim>|auto}\Default{auto}
- The width of the box the text is placed in.
-\end{beschreibung}
-Since version~3.13 of \paket{mhchem} you need to hide the command in braces if
+\begin{example}
+ \ce{
+ 4 C2H5Cl + Pb{/}Na
+ ->
+ \mhName{Pb(C2H5)4}{former antiknock additive} + NaCl
+ }
+\end{example}
+
+There are several keys to customize \cs{mhName}.
+\begin{options}
+ \keyval{align}{alignment command}\Module{mhName}\Default{\cs*{centering}}
+ The alignment of the text in the box it is placed in.
+ \keyval{format}{anything}\Module{mhName}\Default
+ The format of the text.
+ \keyval{fontsize}{font size command}\Module{mhName}\Default{\cs*{tiny}}
+ The fontsize of the text.
+ \keychoice{width}{\meta{dim},auto}\Module{mhName}\Default{auto}
+ The width of the box the text is placed in.
+\end{options}
+
+Since version~3.13 of \pkg{mhchem} you need to hide the command in braces if
you want to use the optional argument,
-\begin{beispiel}
- \ce{4 C2H5Cl + Pb / Na -> {\mhName[fontsize=\footnotesize]{Pb(C2H5)4}{former antiknock additive}} + NaCl}\\
- \chemsetup[mhName]{align=\raggedright,fontsize=\small,format=\bfseries\color{red},width=3cm}
- \ce{4 C2H5Cl + Pb / Na -> \mhName{Pb(C2H5)4}{former antiknock additive} + NaCl}
-\end{beispiel}
-\secidx*{Commands for mhchem}
-
-\section{Reaction Environments}\label{sec:reactions}\secidx{Reaction Environments}
+
+\begin{example}
+ \ce{
+ 4 C2H5Cl + Pb / Na
+ ->
+ {\mhName[fontsize=\footnotesize]{Pb(C2H5)4}{former antiknock additive}}
+ + NaCl
+ }\par
+ \chemsetup[mhName]{
+ align=\raggedright,
+ fontsize=\small,
+ format=\bfseries\color{red},
+ width=3cm
+ }
+ \ce{
+ 4 C2H5Cl + Pb / Na
+ ->
+ \mhName{Pb(C2H5)4}{former antiknock additive} + NaCl
+ }
+\end{example}
+
+\section{Reaction Environments}\label{sec:reactions}
\subsection{Defined by \chemmacros}
You can use these environments for numbered\ldots
-\begin{beschreibung}
- \Umg{reaction}{<formula or mhchem code>}
- \Umg{reactions}{<formula or mhchem code>}
-\end{beschreibung}
+\begin{environments}
+ \environment{reaction}
+ A single reaction where \chemformula\ code is placed directly in the
+ environment body. A wrapper around the \env*{equation} environment.
+ \environment{reactions}
+ Several aligned reactions. A wrapper around \pkg{amsmath}'s \env*{align}
+ environment.
+\end{environments}
\ldots and their starred versions for unnumbered reactions.
-\begin{beschreibung}
- \Umg{reaction*}{<formula or mhchem code>}
- \Umg{reactions*}{<formula or mhchem code>}
-\end{beschreibung}
+\begin{environments}
+ \environment{reaction*}
+ A wrapper around the \env*{equation*} environment.
+ \environment{reactions*}
+ A wrapper around \pkg{amsmath}'s \env*{align*} environment.
+\end{environments}
With them you can create (un)numbered reaction equations similar to
mathematical equations.
-Theses environments use the \code{equation}/\code{equation*} environments or
-the \code{align}/\code{align*} environments, respectively, to display the
+Theses environments use the \env*{equation}/\env*{equation*} environments or
+the \env*{align}/\env*{align*} environments, respectively, to display the
reactions.
-\begin{beispiel}
- Reaction with counter:
- \begin{reaction}
- A -> B
- \end{reaction}
-\end{beispiel}
-
-\begin{beispiel}
- Reaction without counter:
- \begin{reaction*}
- C -> D
- \end{reaction*}
-\end{beispiel}
-
-\begin{beispiel}
- Several aligned reactions with counter:
- \begin{reactions}
- A &-> B + C \\
- D + E &-> F
- \end{reactions}
-\end{beispiel}
-
-\begin{beispiel}
- Several aligned reactions without counter:
- \begin{reactions*}
- G &-> H + I \\
- J + K &-> L
- \end{reactions*}
-\end{beispiel}
+\begin{example}
+ Reaction with counter:
+ \begin{reaction}
+ A -> B
+ \end{reaction}
+\end{example}
+
+\begin{example}
+ Reaction without counter:
+ \begin{reaction*}
+ C -> D
+ \end{reaction*}
+\end{example}
+
+\begin{example}
+ Several aligned reactions with counter:
+ \begin{reactions}
+ A &-> B + C \\
+ D + E &-> F
+ \end{reactions}
+\end{example}
+
+\begin{example}
+ Several aligned reactions without counter:
+ \begin{reactions*}
+ G &-> H + I \\
+ J + K &-> L
+ \end{reactions*}
+\end{example}
If you want to change the layout of the counter tags, you can use
-\cmd{renewtagform}{<tagname>}\oa{<format>}\ma{<right delim>}\ma{<left delim>}%
-\footnote{Provided by the \paket*{mathtools} package}.
+\cs{renewtagform}\marg{tagname}\oarg{format}\marg{right delimiter}\marg{left
+ delimiter}\footnote{Provided by the \pkg{mathtools} package}.
-\begin{beispiel}
- \renewtagform{reaction}[R \textbf]{[}{]}
- \begin{reaction}
- H2O + CO2 <<=> H2CO3
- \end{reaction}
-\end{beispiel}
+\begin{example}
+ \renewtagform{reaction}[R \textbf]{[}{]}
+ \begin{reaction}
+ H2O + CO2 <<=> H2CO3
+ \end{reaction}
+\end{example}
-With version~3.3 referencing and the use of \AmS math's \cmd{intertext} also
+With version~3.3 referencing and the use of \AmS math's \cs{intertext} also
function properly:
-\begin{beispiel}
- \begin{reactions}
- A + 2 B &-> 3 C + D \label{rxn:test}
- \intertext{Some text in between aligned reactions}
- 3 E + F &<=> G + 1/2 H
- \end{reactions}
- See reaction~\ref{rxn:test}.
-\end{beispiel}
-
-\achtung{You should not use \cmd{mch} and its relatives inside the
- \code{reaction} environments.}
+\begin{example}
+ \begin{reactions}
+ A + 2 B &-> 3 C + D \label{rxn:test}
+ \intertext{Some text in between aligned reactions}
+ 3 E + F &<=> G + 1/2 H
+ \end{reactions}
+ See reaction~\ref{rxn:test}.
+\end{example}
+
+\emph{You should not use \cs{mch} and its relatives inside the \env{reaction}
+ environments.}
\subsection{Own Reactions}
You can create new types of reactions with the command:
-\begin{beschreibung}
- \Befehl{DeclareChemReaction}[<keyval>]{<name>}\ma{<math name>}\newline
- \code{<name>} will be the name of the new environment. \code{<math name>}
- is the used math environment.
-\end{beschreibung}
+\begin{commands}
+ \command{DeclareChemReaction}[\oarg{options}\marg{name}\marg{math name}]
+ \meta{name} will be the name of the new environment. \meta{math name}
+ is the underlying math environment.
+\end{commands}
The command has two options.
-\begin{beschreibung}
- \Option*{star}{\default{true}|false}
- \Option*{arg}{\default{true}|false}
-\end{beschreibung}
-There is \key*{star}, which will also define a starred version of the new
+\begin{options}
+ \keybool{star}
+ Also create a starred variant.
+ \keybool{arg}
+ Add a mandatory argument to the defined environment.
+\end{options}
+There is \option{star}, which will also define a starred version of the new
environment, if the starred math environment exists. If it doesn't exist,
this will cause an error.
-Then there is \key*{arg}, which is used to define an environment with a
+Then there is \option{arg}, which is used to define an environment with a
mandatory argument. Of course this only works, if the used math environment
has a mandatory argument.
The predefined environments are defined via
-\begin{beschreibung}
- \Befehl{DeclareChemReaction}[star]{reaction}\ma{equation} and
- \Befehl{DeclareChemReaction}[star]{reactions}\ma{align}.
-\end{beschreibung}
-
-Let's suppose, you'd like to have the alignment behaviour of the
-\code{alignat} environment for \chemformula/\paket{mhchem} reactions. You
-could do the following:
-
-\cmd{DeclareChemReaction}[star,arg]{reactionsat}\ma{alignat}
-
-With this the \code{reactionsat} environment is defined.
-\begin{beispiel}
- \DeclareChemReaction[star,arg]{reactionsat}{alignat}
- \begin{reactionsat}{3}
- A &-> B &&-> C &&-> D \\
- aaaaa &-> bbbbb &&-> ccccc &&-> ddddd
- \end{reactionsat}
- \begin{reactionsat*}{2}
- A &-> B & C &-> D \\
- aaaaa &-> bbbbb &\quad{} ccccc &-> ddddd
- \end{reactionsat*}
-\end{beispiel}
+\begin{sourcecode}
+ \DeclareChemReaction[star]{reaction}{equation}
+ \DeclareChemReaction[star]{reactions}{align}.
+\end{sourcecode}
+
+Let's suppose, you'd like to have the alignment behaviour of the \env{alignat}
+environment for \chemformula\ reactions. You could do the following:
+
+\begin{sourcecode}
+ \DeclareChemReaction[star,arg]{reactionsat}{alignat}
+\end{sourcecode}
+
+With this the \env{reactionsat} environment is defined.
+\begin{example}
+ \DeclareChemReaction[star,arg]{reactionsat}{alignat}
+ \begin{reactionsat}{3}
+ A &-> B &&-> C &&-> D \\
+ aaaaa &-> bbbbb &&-> ccccc &&-> ddddd
+ \end{reactionsat}
+ \begin{reactionsat*}{2}
+ A &-> B & C &-> D \\
+ aaaaa &-> bbbbb &\quad{} ccccc &-> ddddd
+ \end{reactionsat*}
+\end{example}
\subsection{List of Reactions}
\chemmacros\ also provides a command to display a list of the reactions
-created with the \code{reaction} environment.
-\begin{beschreibung}
- \Befehl{listofreactions}
-\end{beschreibung}
-\begin{beispiel}[below]
- \listofreactions
-\end{beispiel}
-
-The Output of this list can be modified by two options:
-\begin{beschreibung}
- \Option[reaction]{list-name}{<name of the list>}\Default{List of reactions}
- Let's you set the name of the list manually. The default name is language
- dependent, see section~\ref{sec:languages}.
- \Option[reaction]{list-entry}{<prefix to each entry>}\Default{Reaction}
- Let's you set a prefix to each list entry. The default name is language
- dependent, see section~\ref{sec:languages}.
-\end{beschreibung}
-Instead of using the option \key{list-name} you also could redefine
-\cmd{reactionlistname}.
+created with the \env{reaction} environment.
+\begin{commands}
+ \command{listofreactions}
+ Print a list of reactions.
+\end{commands}
+\begin{example}
+ \listofreactions
+\end{example}
+
+The output of this list can be modified by two options:
+\begin{options}
+ \keyval{list-name}{name of the list}\Module{reaction}\Default{List of
+ reactions}
+ Let's you set the name of the list manually. The default name is language
+ dependent, see section~\ref{sec:languages}.
+ \keyval{list-entry}{prefix to each entry}\Module{reaction}\Default{Reaction}
+ Let's you set a prefix to each list entry. The default name is language
+ dependent, see section~\ref{sec:languages}.
+\end{options}
+Instead of using the option \option{list-name} you also could redefine
+\cs{reactionlistname}.
The list lists all reactions with a number and disregards reactions without
number. All reaction environments without star have an optional argument
which let's you add a description (or caption) for the entry in the list.
-\begin{beispiel}
- \begin{reaction}[Autoprotolyse]
- 2 H2O <<=> H3O+ + OH-
- \end{reaction}
-\end{beispiel}
-If you use the \code{reactions} environment this will not work, though. In
+\begin{example}
+ \begin{reaction}[Autoprotolyse]
+ 2 H2O <<=> H3O+ + OH-
+ \end{reaction}
+\end{example}
+
+If you use the \env{reactions} environment this will not work, though. In
this case you can use
-\begin{beschreibung}
- \Befehl{AddRxnDesc}{<description>}
-\end{beschreibung}
-\begin{beispiel}
- \begin{reactions}
- Cl "\Lewis{0.,\vphantom{Cl}}" + CH4 &
- -> HCl + "\Lewis{4.,\vphantom{CH}}" CH3 \AddRxnDesc{first~step~of~chain} \\
- "\Lewis{4.,\vphantom{CH}}" CH3 + Cl2 &
- -> CH3Cl + Cl "\Lewis{0.,\vphantom{Cl}}" \AddRxnDesc{second~step~of~chain}
- \end{reactions}
-\end{beispiel}
+\begin{commands}
+ \command{AddRxnDesc}[\marg{description}]
+ Add a description to a reaction.
+\end{commands}
+
+\begin{example}
+ \begin{reactions}
+ Cl "\Lewis{0.,\vphantom{Cl}}" + CH4 &
+ -> HCl + "\Lewis{4.,\vphantom{CH}}" CH3 \AddRxnDesc{first~step~of~chain} \\
+ "\Lewis{4.,\vphantom{CH}}" CH3 + Cl2 &
+ -> CH3Cl + Cl "\Lewis{0.,\vphantom{Cl}}" \AddRxnDesc{second~step~of~chain}
+ \end{reactions}
+\end{example}
+
Note: you don't have to use the phantom commands if you haven't changed the
format of the atoms (see the documentation of the \chemformula\ package for
information on how to do this).
-\secidx*{Reaction Environments}
-
-\section{Phases}\label{sec:phasen}\secidx{Phases}
-\subsection{Basics}\secidx[basics]{Phases}
+\section{Phases}\label{sec:phasen}
+\subsection{Basics}
These commands are intended to indicate the phase of a compound.
-\begin{beschreibung}
- \Befehl{sld} \sld
- \Befehl{lqd} \lqd
- \Befehl{gas} \gas
- \Befehl{aq} \aq
-\end{beschreibung}
-
-\achtung{The default behaviour of the phases commands has changed to be
- consistent with \ac{iupac} recommendations. Both \cmd{sld} and \cmd{lqd}
- have lost their optional argument.}
-
-\begin{beispiel}
- \ch{C\sld{} + 2 H2O\lqd{} -> CO2\gas{} + 2 H2\gas}\\
- To make it complete: NaCl\aq.
-\end{beispiel}
+\begin{itemize}
+ \item[]
+ \cs{sld} \sld \quad
+ \cs{lqd} \lqd \quad
+ \cs{gas} \gas \quad
+ \cs{aq} \aq
+\end{itemize}
+
+\begin{example}
+ \ch{C\sld{} + 2 H2O\lqd{} -> CO2\gas{} + 2 H2\gas}\par
+ To make it complete: NaCl\aq.
+\end{example}
The \ac{iupac} recommendation to indicate the state of aggregation is to put
it in parentheses after the compound \cite{iupac:greenbook}. However, you
might want to put it as a subscript which is also very common.
-\begin{zitat}[{\acs{iupac} Green Book {\cite[][p.\,54]{iupac:greenbook}}}]
+\begin{cnltxquote}[{\acs{iupac} Green Book {\cite[][p.\,54]{iupac:greenbook}}}]
The \textelp{} symbols are used to represent the states of aggregation of
chemical species. The letters are appended to the formula in parentheses
and should be printed in Roman (upright) type without a full stop (period).
-\end{zitat}
+\end{cnltxquote}
There are two options to customize the output:
-\begin{beschreibung}
- \Option[phases]{pos}{side|sub}\Default{side}
- Switch the position of the phase indicator.
- \Option[phases]{space}{<dim>}\Default{.1333em}
- Change the default spacing between compound a phase indicator if
- \key{pos}{side}. A \TeX\ dimension.
-\end{beschreibung}
-\begin{beispiel}
- \chemsetup[phases]{pos=sub}
- \ch{C\sld{} + 2 H2O\lqd{} -> CO2\gas{} + 2 H2\gas}\\
- To make it complete: NaCl\aq.
-\end{beispiel}
-
-\subsection{Define Own Phases}\secidx[own]{Phases}
+\begin{options}
+ \keychoice{pos}{side,sub}\Module{phases}\Default{side}
+ Switch the position of the phase indicator.
+ \keyval{space}{dim}\Module{phases}\Default{.1333em}
+ Change the default spacing between compound a phase indicator if
+ \keyis{pos}{side}. A \TeX\ dimension.
+\end{options}
+\begin{example}
+ \chemsetup[phases]{pos=sub}
+ \ch{C\sld{} + 2 H2O\lqd{} -> CO2\gas{} + 2 H2\gas}\par
+ To make it complete: NaCl\aq.
+\end{example}
+
+
+\subsection{Define Own Phases}
Depending on the subject of your document you might need to indicate other
states of aggregation. You can easily define them.
-\begin{beschreibung}
- \Befehl{DeclareChemPhase}{<cmd>}\oa{<german>}\ma{<english>}
- \Befehl{RenewChemPhase}{<cmd>}\oa{<german>}\ma{<english>}
- \Befehl{phase}{<phase>}\newline
- If you need a phase indicator just once or twice.
-\end{beschreibung}
-\cmd{DeclareChemPhase} only defines a phase if \code{<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{RenewChemPhase} \emph{only} defines a phase if \code{<cmd>} \emph{is}
-already used and issues a warning/error otherwise. Unlike the other
-declaration commands of \chemmacros\ \cmd{DeclareChemPhase} and
-\cmd{RenewChemPhase} \emph{can only be used in the preamble.}
-
-\begin{beispiel}
- % preamble:
- % \DeclareChemPhase{\aqi}{aq,$\infty$}% aqueous solution at infinite dilution
- % \DeclareChemPhase{\cd}{cd}% condensed phase
- % \DeclareChemPhase{\lc}{lc}% liquid crystal
- NaOH\aqi\ \ch{H2O\cd} U\phase{cr} A\lc \\
- \chemsetup[phases]{pos=sub}
- NaOH\aqi\ \ch{H2O\cd} U\phase{cr} A\lc
-\end{beispiel}
-
-\subsection{Language Dependencies}\secidx[internationalization]{Phases}
+\begin{commands}
+ \command{DeclareChemPhase}[\marg{cs}\oarg{german}\marg{english}]
+ Define a new phase command. Actually the optional argument is an artefact
+ of an earlier implementation of the command. It has no effect at all.
+ See section~\ref{sec:lang-depend} for a way to define language dependent
+ settings.
+ \command{RenewChemPhase}[\marg{cs}\oarg{german}\marg{english}]
+ Redefine an existing pahse command. Actually the optional argument is an
+ artefact of an earlier implementation of the command. It has no effect at
+ all. See section~\ref{sec:lang-depend} for a way to define language
+ dependent settings.
+ \command{phase}[\marg{phase}]
+ If you need a phase indicator just once or twice.
+\end{commands}
+
+\cs{DeclareChemPhase} only defines a phase if \meta{cs} 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 \option{strict}.
+\cs{RenewChemPhase} \emph{only} defines a phase if \meta{cs} \emph{is} already
+used and issues a warning/error otherwise. Unlike the other declaration
+commands of \chemmacros\ \cs{DeclareChemPhase} and \cs{RenewChemPhase}
+\emph{can only be used in the preamble.}
+
+\begin{example}
+ % preamble:
+ % \DeclareChemPhase{\aqi}{aq,$\infty$}% aqueous solution at infinite dilution
+ % \DeclareChemPhase{\cd}{cd}% condensed phase
+ % \DeclareChemPhase{\lc}{lc}% liquid crystal
+ NaOH\aqi\ \ch{H2O\cd} U\phase{cr} A\lc \par
+ \chemsetup[phases]{pos=sub}
+ NaOH\aqi\ \ch{H2O\cd} U\phase{cr} A\lc
+\end{example}
+
+\subsection{Language Dependencies}\label{sec:lang-depend}
For each pahse command a translation into the custom language can be defined.
-If a phase is declared with \cmd{DeclareChemPhase} no translation exists and
-for every \paket{babel} languuage the literal string is used that was provided
+If a phase is declared with \cs{DeclareChemPhase} no translation exists and
+for every \pkg{babel} languuage the literal string is used that was provided
as a definition. Let's say you define the phase
-\begin{beispiel}[code only]
- \DeclareChemPhase\liquid{l}
-\end{beispiel}
+\begin{sourcecode}
+ \DeclareChemPhase\liquid{l}
+\end{sourcecode}
and want to add the German translation ``f{}l''. Then you could do
-\begin{beispiel}[code only]
- \DeclareTranslation{German}{phase-liquid}{f{}l}
-\end{beispiel}
+\begin{sourcecode}
+ \DeclareTranslation{German}{phase-liquid}{f{}l}
+\end{sourcecode}
This way, when you use it in a German document using the appropriate
-\paket{babel} option using \cmd*{liquid} would correctly translate. For this
-the package \paket{translations} is used. The \acs{id} always is
-\code{phase-<csname>} where \code{<csname>} is the name of the phase command
-you defined without leading backslash.
+\pkg{babel} option using \cs*{liquid} would correctly translate. For this the
+package \pkg{translations} is used. The \acs{id} always is
+\code{phase-\meta{csname}} where \meta{csname} is the name of the phase
+command you defined without leading backslash.
See section~\ref{sec:languages} for predefined translations.
-\secidx*{Phases}
-
-\section{Newman Projections}\label{sec:newman}\secidx{Newman Projections}
-\chemmacros provides the command
-\begin{beschreibung}
- \Befehl{newman}[<keyval>]\da{<angle>}\ma{<1>,<2>,<3>,<4>,<5>,<6>}
-\end{beschreibung}
-which allows you to create newman projections (uses \TikZ). With
-\code{<angle>} the back atoms are rotated counter clockwise with respect to
-the front atoms.
-\begin{beispiel}
- \newman{} \newman(170){}
- \newman{1,2,3,4,5,6} \newman{1,2,3} \newman{,,,4,5,6}
-\end{beispiel}
+
+\section{Newman Projections}\label{sec:newman}
+\chemmacros\ provides a command to draw Newman projections.
+\begin{commands}
+ \command{newman}[\oarg{options}\darg{angle}%
+ \Marg{\meta{1},\meta{2},\meta{3},\meta{4},\meta{5},\meta{6}}]
+ Create Newman projections. This command uses \TikZ\ internally.
+ \meta{angle} rotates the back atoms counter clockwise with respect to the
+ front atoms and is an optional argument. \meta{1} to \meta{6} are the
+ positions, the first three are the front atoms, the last three the back
+ atoms.
+\end{commands}
+
+\begin{example}
+ \newman{} \newman(170){}
+ \newman{1,2,3,4,5,6} \newman{1,2,3} \newman{,,,4,5,6}
+\end{example}
Several options allow customization:
-\begin{beschreibung}
- \Option[newman]{angle}{<angle>}\Default{0}
- Default angle.
- \Option[newman]{scale}{<factor>}\Default{1}
- Scale the whole projection.
- \Option[newman]{ring}{<tikz>}\Default{}
- Customize the ring with \TikZ keys.
- \Option[newman]{atoms}{<tikz>}\Default{}
- Customize the nodes within which the atoms are set.
- \Option[newman]{back-atoms}{<tikz>}\Default{}
- Explicitly customize the back atoms.
-\end{beschreibung}
-
-\begin{beispiel}
- \chemsetup[newman]{angle=45} \newman{}
- \newman[scale=.75,ring={draw=blue,fill=blue!20}]{}
-\end{beispiel}
-\begin{beispiel}
- \chemsetup[newman]{atoms={draw=red,fill=red!20,inner sep=2pt,rounded corners}}
- \newman{1,2,3,4,5,6}
-\end{beispiel}
-\begin{beispiel}
- \chemsetup[newman]{
- atoms = {draw=red,fill=red!20,inner sep=2pt,rounded corners},
- back-atoms = {draw=blue,fill=blue!20,inner sep=2pt,rounded corners}
- }
- \newman{1,2,3,4,5,6} \newman(170){1,2,3,4,5,6}
-\end{beispiel}
-\secidx*{Newman Projections}
-
-\section{s, p, and Hybrid Orbitals}\label{sec:orbitale}\secidx{Orbitals}
-
-\chemmacros provides the following command to create orbitals:
-\begin{beschreibung}
- \Befehl{orbital}[<keyval>]{<type}
-\end{beschreibung}
-
-There are the following types available for \code{<type>}:
-\begin{description}
- \item \code{s}
- \item \code{p}
- \item \code{sp}
- \item \code{sp2}
- \item \code{sp3}
-\end{description}
-
-\begin{beispiel}
- \orbital{s} \orbital{p} \orbital{sp} \orbital{sp2} \orbital{sp3}
-\end{beispiel}
+\begin{options}
+ \keyval{angle}{angle}\Module{newman}\Default{0}
+ Default angle.
+ \keyval{scale}{factor}\Module{newman}\Default{1}
+ Scale the whole projection by factor \meta{factor}.
+ \keyval{ring}{tikz}\Module{newman}\Default
+ Customize the ring with \TikZ\ keys.
+ \keyval{atoms}{tikz}\Module{newman}\Default
+ Customize the nodes within which the atoms are set with \TikZ\ keys.
+ \keyval{back-atoms}{tikz}\Module{newman}\Default
+ Explicitly customize the nodes of the back atoms with \TikZ\ keys.
+\end{options}
+
+\begin{example}
+ \chemsetup[newman]{angle=45} \newman{}
+ \newman[scale=.75,ring={draw=blue,fill=blue!20}]{}
+\end{example}
+
+\begin{example}
+ \chemsetup[newman]{atoms={draw=red,fill=red!20,inner sep=2pt,rounded corners}}
+ \newman{1,2,3,4,5,6}
+\end{example}
+
+\begin{example}
+ \chemsetup[newman]{
+ atoms = {draw=red,fill=red!20,inner sep=2pt,rounded corners},
+ back-atoms = {draw=blue,fill=blue!20,inner sep=2pt,rounded corners}
+ }
+ \newman{1,2,3,4,5,6} \newman(170){1,2,3,4,5,6}
+\end{example}
+
+\section{s, p, and Hybrid Orbitals}\label{sec:orbitale}
+
+\chemmacros\ provides the following command to create orbitals:
+\begin{commands}
+ \command{orbital}[\oarg{options}\marg{type}]
+ Draw an orbital shape of type \meta{type}. This command uses \TikZ\
+ internally.
+\end{commands}
+
+There are the following types available for \meta{type}:
+\begin{itemize}
+ \item[]
+ \code{s} \quad
+ \code{p} \quad
+ \code{sp} \quad
+ \code{sp2} \quad
+ \code{sp3}
+\end{itemize}
+
+\begin{example}
+ \orbital{s} \orbital{p} \orbital{sp} \orbital{sp2} \orbital{sp3}
+\end{example}
Depending on the type you have different options to modify the orbitals:
-\begin{beschreibung}
- \Option[orbital]{phase}{\default{+}|-}\newline
- changes the phase of the orbital (all types)
- \Option[orbital]{scale}{<factor>}\newline
- changes the size of the orbital (all types)
- \Option[orbital]{color}{<color>}\newline
- changes the color of the orbital (all types)
- \Option[orbital]{angle}{<angle>}\newline
- rotates the orbitals with a p contribution counter clockwise (all types
- except \code{s})
- \Option[orbital]{half}{\default{true}|false}\newline
- displays only half an orbital (only \code{p})
-\end{beschreibung}
-
-\begin{beispiel}
- \orbital{s} \orbital[phase=-]{s}
- \orbital{p} \orbital[phase=-]{p}
- \orbital{sp3} \orbital[phase=-]{sp3}
+\begin{options}
+ \keychoice{phase}{\default{+},-}\Module{orbital}\Default{+}
+ changes the phase of the orbital (all types)
+ \keyval{scale}{factor}\Module{orbital}\Default{1}
+ changes the size of the orbital (all types)
+ \keyval{color}{color}\Module{orbital}\Default{black}
+ changes the color of the orbital (all types)
+ \keyval{angle}{angle}\Module{orbital}\Default{0}
+ rotates the orbitals with a p contribution counter clockwise (all types
+ except \code{s})
+ \keybool{half}\Module{orbital}\Default{false}
+ displays only half an orbital (only \code{p})
+\end{options}
+
+\begin{example}
+ \orbital{s} \orbital[phase=-]{s}
+ \orbital{p} \orbital[phase=-]{p}
+ \orbital{sp3} \orbital[phase=-]{sp3}
- \orbital[angle=0]{p} \orbital[color=red!50]{p}
- \orbital[angle=135,scale=1.5]{p} \orbital[half]{p}
-\end{beispiel}
+ \orbital[angle=0]{p} \orbital[color=red!50]{p}
+ \orbital[angle=135,scale=1.5]{p} \orbital[half]{p}
+\end{example}
-Additionally there are two options, with which the \TikZ behaviour can be
+Additionally there are two options, with which the \TikZ\ behaviour can be
changed.
-\begin{beschreibung}
- \Option[orbital]{overlay}{\default{true}|false}\newline
- The orbital \enquote{doesn't need space}; it is displayed with the \TikZ
- option \code{overlay}.
- \Option[orbital]{opacity}{<num>}\newline
- The orbital becomes transparent; \code{<value>} can have values between
- \code{1} (fully opaque) to \code{0} (invisible).
-\end{beschreibung}
-\begin{beispiel}[dist]
- \hspace{1cm}
- \chemsetup[orbital]{
- overlay,
- p/color = black!70
- }
- \setbondoffset{0pt}
- \chemfig{
- ?\orbital{p}
- -[,1.3]{\orbital[phase=-]{p}}
- -[:30,1.1]\orbital{p}
- -[:150,.9]{\orbital[phase=-]{p}}
- -[4,1.3]\orbital{p}
- -[:-150,1.1]{\orbital[phase=-]{p}}?
- }
- \vspace{7mm}
-\end{beispiel}
-
-\bspmidlength{dist}{10mm}
-\begin{beispiel}[dist]
- \hspace{2cm}
- \setbondoffset{0pt}
- \chemsetup[orbital]{
- overlay ,
- opacity = .75 ,
- p/scale = 1.6 ,
- s/color = blue!50 ,
- s/scale = 1.6
- }
- \chemfig{
- \orbital{s}
- -[:-20]{\orbital[scale=2]{p}}{\orbital[half,angle=0]{p}}{\orbital[angle=170,half]{p}}{\orbital[angle=-150,half]{p}}
- (-[:-150]\orbital{s})-\orbital{s}
- }
- \vspace{1cm}
-\end{beispiel}
-\bspmidlength{dist}{7mm}
-\secidx*{Orbitals}\secidx*{CHEMMACROS}
+\begin{options}
+ \keybool{overlay}\Module{orbital}
+ The orbital \enquote{doesn't need space}; it is displayed with the \TikZ\
+ option \code{overlay}.
+ \keyval{opacity}{num}\Module{orbital}
+ The orbital becomes transparent; \meta{value} can have values between
+ \code{1} (fully opaque) to \code{0} (invisible).
+\end{options}
+\begin{example}
+ \vspace{7mm}
+ \chemsetup[orbital]{
+ overlay,
+ p/color = black!70
+ }
+ \setbondoffset{0pt}
+ \chemfig{
+ ?\orbital{p}
+ -[,1.3]{\orbital[phase=-]{p}}
+ -[:30,1.1]\orbital{p}
+ -[:150,.9]{\orbital[phase=-]{p}}
+ -[4,1.3]\orbital{p}
+ -[:-150,1.1]{\orbital[phase=-]{p}}?
+ }
+ \vspace{7mm}
+\end{example}
+
+\begin{example}
+ \vspace{7mm}
+ \setbondoffset{0pt}
+ \chemsetup[orbital]{
+ overlay ,
+ opacity = .75 ,
+ p/scale = 1.6 ,
+ s/color = blue!50 ,
+ s/scale = 1.6
+ }
+ \chemfig{
+ \orbital{s}
+ -[:-20]{\orbital[scale=2]{p}}
+ {\orbital[half,angle=0]{p}}
+ {\orbital[angle=170,half]{p}}
+ {\orbital[angle=-150,half]{p}}
+ (-[:-150]\orbital{s})-\orbital{s}
+ }
+ \vspace{1cm}
+\end{example}
\part{Other Packages of the Bundle}
-The other three package, \chemformula, \ghsystem\ and \chemgreek, all have
-their own documentation:
+The other three packages, \chemformula, \ghsystem\ and \chemgreek, all have
+their own documentation (if you click on the name the corresponding file will
+open):
\begin{itemize}
\item \url{chemformula_en.pdf}
\item \url{ghsystem_en.pdf}
@@ -2269,11 +2345,11 @@ names in the list above. They are links and \emph{should} open the respective
file.
\appendix
-\part{Appendix}\index{APPENDIX@\textbf{APPENDIX}}
+\part{Appendix}
\addsec{Suggestions and Bug Reports}
-Feedback on \chemmacros, \chemformula and \ghsystem is highly appreciated and
-welcome!
+Feedback on \chemmacros, \chemformula, \chemgreek, and \ghsystem\ is highly
+appreciated and welcome!
If you have suggestions for macros, missing features \etc, please don't
hesitate to contact me. If you recognize any errors, be it chemical ones,
@@ -2287,18 +2363,13 @@ with which I can reproduce the bug. You can also submit an issue on
Many thanks to all the people who already provided me with feedback,
especially (in alphabetical order):
\begin{itemize}
- \item Peter Cao
- \item Christina Lüdigk
- \item Dr.\ Paul King
- \item Jonas Rivetti (Special thanks for his translation of the hazard and
- precautionary statements into Italian!)
- \item Christoph Schäfer
- \item Timo Stein
+ \item Peter Cao
+ \item Christina Lüdigk
+ \item Dr.~Paul King
+ \item Jonas Rivetti (Special thanks for his translation of the hazard and
+ precautionary statements into Italian!)
+ \item Christoph Schäfer
+ \item Timo Stein
\end{itemize}
-\printbibliography
-
-{\catcode`\^=11 \catcode`\#=11
-\printindex}
-
\end{document}
diff --git a/Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.pdf b/Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.pdf
index 3f04b35d2f0..a1e29a653ff 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.pdf
+++ b/Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.tex b/Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.tex
index e96adeea541..f4a2c54f7d3 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.tex
+++ b/Master/texmf-dist/doc/latex/chemmacros/ghsystem_en.tex
@@ -1,48 +1,130 @@
-% arara: xelatex
+% arara: pdflatex
% !arara: biber
-% !arara: xelatex
-% !arara: xelatex
-\documentclass[DIV11,toc=index,toc=bib]{cnpkgdoc}
-\docsetup{
- pkg = {[greek=newtx]chemmacros} ,
- language = en,
- title = the \Chemmacros\ bundle,
- subtitle = {
- packages \Chemmacros\ (v\csname chemmacros@version\endcsname),
- \Chemformula\ (v\csname chemformula@version\endcsname),
- \Ghsystem\ (v\csname ghsystem@version\endcsname) and
- \Chemgreek\ (v\csname chemgreek@version\endcsname)\\[2ex]
- {\Large documentation for the \Ghsystem\ package}},
- modules = true,
- code-box = {skipabove=1ex,skipbelow=1ex},
- label = {},
- name = ghsystem ,
- url = https://bitbucket.org/cgnieder/chemmacros/
+% !arara: pdflatex
+% arara: pdflatex
+% --------------------------------------------------------------------------
+% the CHEMMACROS bundle
+% ghsystem_en.tex
+% macros and commands for chemists
+% --------------------------------------------------------------------------
+% Clemens Niederberger
+% --------------------------------------------------------------------------
+% https://bitbucket.org/cgnieder/chemmacros/
+% contact@mychemistry.eu
+% --------------------------------------------------------------------------
+% If you have any ideas, questions, suggestions or bugs to report, please
+% feel free to contact me.
+% --------------------------------------------------------------------------
+% Copyright 2011-2013 Clemens Niederberger
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Clemens Niederberger.
+% --------------------------------------------------------------------------
+\documentclass[load-preamble+]{cnltx-doc}
+\usepackage[greek=newtx]{chemmacros}
+\setcnltx{
+ package = {ghsystem},
+ date = \csname ghsystem@date\endcsname ,
+ version = v\csname ghsystem@version\endcsname ,
+ title = \huge the \chemmacros\ bundle,
+ url = https://bitbucket.org/cgnieder/chemmacros/ ,
+ authors = Clemens Niederberger ,
+ email = contact@mychemistry.eu ,
+ info = {
+ packages \chemmacros\ (v\csname chemmacros@version\endcsname),
+ \chemformula\ (v\csname chemformula@version\endcsname),
+ \ghsystem\ (v\csname ghsystem@version\endcsname) and
+ \chemgreek\ (v\csname chemgreek@version\endcsname)\\[2ex]
+ {\Large documentation for the \ghsystem\ package}} ,
+ abstract = {%
+ \centering
+ \includegraphics{chemmacros-logo.pdf}
+ \par
+ } ,
+ add-cmds = {
+ abinitio, activatechemgreekmapping, AddRxnDesc, anti, aq, aqi,
+ ba, bond, bridge,
+ cd, ch, changechemgreeksymbol, charrow, chcpd, chemabove, Chemalpha,
+ Chembeta, Chemgamma, Chemdelta, ChemDelta, chemformula@bondlength,
+ Chemomega, Chemphi, ChemPhi, chemsetup, chlewis, chname , cip, cis, ch,
+ CNMR,
+ data, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias,
+ declarechemgreekmapping, DeclareChemIUPAC, DeclareChemLatin,
+ DeclareChemNMR, DeclareChemParticle, DeclareChemPhase,
+ DeclareChemReaction, DeclareChemState, delm, delp, Delta, Dfi,
+ el, ElPot, endo, Enthalpy, enthalpy, Entropy,
+ fmch, fpch, fscrm, fscrp,
+ gas, ghs, ghslistall, ghspic, Gibbs, gram,
+ hapto, HNMR, Helmholtz,
+ insitu, invacuo, iupac,
+ Ka, Kb, Kw,
+ Lfi, listofreactions, lqd, ltn,
+ mch, mega, meta, mhName,
+ newchemgreekmapping,
+ newman, NMR, Nu, Nuc,
+ orbital, ortho, ox, OX,
+ para, pch, per, pH, phase, photon, pKa, pKb, pOH, pos, positron,
+ Pot, prt,
+ Rad, redox, RenewChemArrow, RenewChemBond, renewchemgreekmapping,
+ RenewChemIUPAC, RenewChemLatin, RenewChemNMR, RenewChemParticle,
+ RenewChemPhase, RenewChemState,
+ Sf, scrm, scrp, second, selectchemgreekmapping, setchemformula,
+ ShowChemArrow, ShowChemBond, sld, Sod, State,
+ trans,
+ val
+ } ,
+ add-silent-cmds = {
+ addplot,
+ bottomrule,
+ cancel, cdot, ce, cee, celsius, centering, chemfig, chemname, clap,
+ cnsetup, color, cstack, cstsetup,
+ DeclareInstance, DeclareSIUnit, definecolor, draw,
+ electronvolt,
+ footnotesize,
+ glqq, grqq,
+ hertz, hspace,
+ includegraphics, intertext, IUPAC,
+ joule,
+ kilo,
+ latin, lewis, Lewis,
+ metre, midrule, milli, mmHg, mole,
+ nano, nicefrac, num, numrange,
+ ominus, oplus,
+ percent, pgfarrowsdeclarealias, pgfarrowsrenewalias,
+ renewtagform, rightarrow,
+ sample, scriptscriptstyle, setatomsep, setbondoffset, sfrac, shorthandoff,
+ si, SI, sisetup, square, subsection,
+ textcolor, textendash, textsuperscript, tiny, toprule,
+ upbeta, upeta, upgamma, usetikzlibrary,
+ volt, vphantom, vspave,
+ xspace
+ }
}
-\usepackage{booktabs,cancel}
-\usepackage{fontspec}
-\usepackage[oldstyle,proportional]{libertine}
-\usepackage[libertine]{newtxmath}
-\usepackage{libertinehologopatch}
-\setmonofont[Scale=MatchLowercase]{Bitstream Vera Sans Mono}
-\cnpkgusecolorscheme{friendly}
-\renewcommand*\othersectionlevelsformat[3]{%
- \textcolor{main}{#3\autodot}\enskip}
-\renewcommand*\partformat{%
- \textcolor{main}{\partname~\thepart\autodot}}
+\usepackage{chemfig,booktabs,cancel,varioref}
+\usepackage[version=3]{mhchem}
+
+\expandafter\def\csname libertine@figurestyle\endcsname{LF}
+\usepackage[libertine]{newtxmath}
+\expandafter\def\csname libertine@figurestyle\endcsname{OsF}
-\usepackage{fnpct}
\usepackage[biblatex]{embrac}
\ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
-\pagestyle{headings}
-
\usepackage[accsupp]{acro}
\acsetup{
- long-format=\scshape,
- short-format=\scshape
+ long-format = \scshape ,
+ short-format = \scshape
}
\DeclareAcronym{ghs}{
short = ghs ,
@@ -52,10 +134,10 @@
accsupp = GHS
}
\DeclareAcronym{eu}{
- short = eu ,
+ short = EU ,
long = European Union ,
pdfstring = EU ,
- accsupp = EU ,
+ accsupp = EU
}
\DeclareAcronym{iupac}{
short = iupac ,
@@ -84,71 +166,59 @@
\chemsetup{
option/synchronize ,
- chemformula/font-spec={[Numbers=Lining]Linux Libertine O}
+ chemformula/format = \libertineLF
}
-\colorlet{chemformula}{darkgray}
+% \colorlet{chemformula}{black!90}
\sisetup{
detect-mode=false,
mode=text,
- text-rm=\addfontfeatures{Numbers={Proportional,Lining}}
+ text-rm=\libertineLF
}
\usepackage{filecontents}
-\begin{filecontents*}{\jobname.ist}
- preamble "\\begin{theindex}\n Section titles are indicated \\textbf{bold},
- packages \\textsf{sans serif}, commands \\code{\\textbackslash\\textcolor{code}{brown}},
- options \\textcolor{key}{\\code{yellow}} and modules (only \\chemmacros)
- \\textcolor{module}{\\code{blue}}.\\newline\n\n"
- heading_prefix "{\\bfseries "
- heading_suffix "\\hfil}\\nopagebreak\n"
- headings_flag 1
- delim_0 "\\dotfill\\hyperpage{"
- delim_1 "\\dotfill\\hyperpage{"
- delim_2 "\\dotfill\\hyperpage{"
- delim_r "}\\textendash\\hyperpage{"
- delim_t "}"
- suffix_2p "\\nohyperpage{\\,f.}"
- suffix_3p "\\nohyperpage{\\,ff.}"
-\end{filecontents*}
-
-\usepackage[backend=biber,style=alphabetic,maxbibnames=20]{biblatex}
\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ürgen Stohner and Herbert L. Strauss and
- Michio Takami and Anders J Thor},
- title = {“Quantities, Symbols and Units in Physical Chemistry”, \acs{iupac}
- Green Book},
- edition = {3rd Edition. 2nd Printing},
- year = {2008},
+ Bertil Holmstr\"om and Kozo Kuchitsu and Roberto Marquardt and Ian Mills and
+ Franco Pavese and Martin Quack and J\"urgen Stohner and Herbert L. Strauss and
+ Michio Takami and Anders J Thor} ,
+ title = {``Quantities, Symbols and Units in Physical Chemistry'', \acs{iupac}
+ Green Book} ,
+ sorttitle = {Quantities, Symbols and Units in Physical Chemistry} ,
+ indexsorttitle = {Quantities, Symbols and Units in Physical Chemistry} ,
+ edition = {3rd Edition. 2nd Printing} ,
+ year = {2008} ,
publisher = {\acs{iupac} \&\ RSC Publishing, Cambridge}
}
@book{iupac:redbook,
author = {Neil G. Connelly and Ture Damhus and Richard M. Hartshorn and
- Alan T. Hutton},
- title = {“Nomenclature of Inorganic Chemistry”, \acs{iupac} Red Book},
- year = {2005},
- publisher = { \acs{iupac} \&\ RSC Publishing, Cambridge},
+ Alan T. Hutton} ,
+ title = {``Nomenclature of Inorganic Chemistry'', \acs{iupac} Red Book} ,
+ sorttitle = {Nomenclature of Inorganic Chemistry} ,
+ indexsorttitle = {Nomenclature of Inorganic Chemistry} ,
+ year = {2005} ,
+ publisher = { \acs{iupac} \&\ RSC Publishing, Cambridge} ,
isbn = {0-85404-438-8}
}
@misc{eu:ghsystem_regulation,
author = {{The European Parliament and The Council of the European Union}},
- title = {Regulation (EC) No 1272/2008 of the European Parliament and of the Council},
- subtitle = {on classification, labelling and packaging of substances and mixtures,
- amending and repealing Directives 67/548/EEC and 1999/45/EC, and amending
- Regulation (EC) No 1907/2006},
- journal = {Official Journal of the European Union},
+ title = {Regulation (EC) No 1272/2008 of the European Parliament and of
+ the Council} ,
+ subtitle = {on classification, labelling and packaging of substances and
+ mixtures, amending and repealing Directives 67/548/EEC and 1999/45/EC, and
+ amending Regulation (EC) No 1907/2006} ,
+ journal = {Official Journal of the European Union} ,
date = {2008-12-16}
}
@online{unece:ghsystem_implementation,
- author = {United Nations Economic Commission for Europe},
- title = {GHS Implementation},
- url = {http://www.unece.org/trans/danger/publi/ghs/implementation_e.html},
- urldate = {2012-03-20},
+ author = {{United Nations Economic Commission for Europe}} ,
+ title = {GHS Implementation} ,
+ url =
+ {http://www.unece.org/trans/danger/publi/ghs/implementation_e.html} ,
+ urldate = {2012-03-20} ,
date = {2012-03-20}
}
\end{filecontents*}
@@ -166,126 +236,25 @@
\usetikzlibrary{calc,positioning,decorations.pathmorphing,patterns}
-\pgfdeclaredecoration{penciline}{initial}{
- \state{initial}[
- width=+\pgfdecoratedinputsegmentremainingdistance,
- auto corner on length=1mm
- ]{
- \pgfpathcurveto%
- {% From
- \pgfqpoint
- {\pgfdecoratedinputsegmentremainingdistance}
- {\pgfdecorationsegmentamplitude}
- }
- {% Control 1
- \pgfmathrand
- \pgfpointadd
- {\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- {%
- \pgfqpoint
- {-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}%
- {\pgfmathresult\pgfdecorationsegmentamplitude}
- }
- }
- {%TO
- \pgfpointadd
- {\pgfpointdecoratedinputsegmentlast}
- {\pgfpoint{1pt}{1pt}}
- }
- }
- \state{final}{}
-}
-\tikzset{pencil/.style={decorate,decoration=penciline}}
-
-\TitlePicture{%
- \ch[font-spec={Augie}]{
- 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
- ->
- 2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
- }
- \redox(o1,o2)[red,pencil,-cf]{\small\ch[font-spec={[Color=red]Augie},math-space=.3em]{$-$ 2 e-}}
- \redox(r1,r2)[blue,pencil,-cf][-1]{\small\ch[font-spec={[Color=blue]Augie},math-space=.3em]{$+$ 2 e-}}}
-
-\addcmds{
- a, abinitio, AddRxnDesc, anti, aq, aqi,
- b, ba, bond, bottomrule, bridge,
- cancel, cd, cdot, ce, cee, celsius, centering, changechemgreeksymbol,
- chemabove, Chemalpha, Chembeta, Chemgamma, ChemGamma, Chemdelta,
- ChemDelta, chemfig, chemname, Chemomega, Chemphi, ChemPhi, chemsetup, cip,
- cis, ch, clap, cnsetup, CNMR, color, cstack,
- cstsetup,
- d, D, data, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias,
- DeclareChemIUPAC, DeclareChemLatin, DeclareChemNMR, DeclareChemParticle,
- DeclareChemPhase, DeclareChemReaction, DeclareChemState, DeclareInstance,
- DeclareSIUnit, definecolor, delm, delp, Delta, Dfi, draw,
- E, el, electronvolt, ElPot, endo, Enthalpy, enthalpy, Entropy,
- footnotesize, fmch, fpch, fscrm, fscrp,
- g, gas, ghs, ghslistall, ghspic, Gibbs, glqq, gram, grqq,
- H, hapto, HNMR, Helmholtz, hertz, hspace,
- includegraphics, insitu, intertext, invacuo, iupac, IUPAC,
- J, joule,
- Ka, Kb, kilo, Kw,
- L, latin, lewis, Lewis, Lfi, listofreactions, lqd, ltn,
- mch, mega, meta, metre, mhName, midrule, milli, mmHg, mole,
- N, nano, nicefrac, newchemgreekmapping, newman, NMR, Nu, Nuc, num, numrange,
- O, ominus, orbital, ortho, oplus, ox, OX,
- p, P, para, pch, per, percent, pgfarrowsdeclarealias, pgfarrowsrenewalias,
- pH, phase, phi, Phi, photon, pKa, pKb, pOH, pos, positron, Pot, prt,
- R, Rad, redox, RenewChemArrow, RenewChemBond, RenewChemIUPAC,
- RenewChemLatin, RenewChemNMR, RenewChemParticle, RenewChemPhase,
- RenewChemState, renewtagform, rightarrow,
- S, Sf, sample, scriptscriptstyle, scrm, scrp, second,
- selectchemgreekmapping, setatomsep, setbondoffset, setchemformula, sfrac,
- shorthandoff, ShowChemArrow, ShowChemBond, si, SI, sisetup, sld, Sod,
- square, State, subsection,
- textcolor, textendash, textsuperscript, tiny, toprule, trans,
- upbeta, upeta, upgamma, upphi, upPhi, Upphi,
- val, volt, vphantom, vspave,
- w, xspace, Z
-}
-
-\usepackage{imakeidx}
-\indexsetup{othercode=\footnotesize}
-\makeindex[columns=3,intoc,options={-sl \jobname.ist}]
-
-\newcommand*\Chemmacros{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemmacros%
- }%
-}
-\providecommand*\chemmacros{{\scshape\textcolor{main}{chemmacros}}\xspace}
+\newpackagename\chemmacros{chemmacros}
+\newpackagename\chemformula{chemformula}
+% \newpackagename\ghsystem{ghsystem}
+\newpackagename\chemgreek{chemgreek}
-\newcommand*\Chemformula{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemformula%
- }%
-}
-\providecommand*\chemformula{{\scshape\textcolor{main}{chemformula}}\xspace}
-\newcommand*\Ghsystem{%
- {%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- ghsystem%
- }%
-}
-\providecommand*\ghsystem{{\scshape\textcolor{main}{ghsystem}}\xspace}
+\newidxcmd\manual{\textsf{#1}}[\ (manual)]
-\newcommand*\Chemgreek{%
+\newenvironment{codedesc}
{%
- \fontspec[Color=main,Scale=1.2]
- {Linux Biolinum Shadow O}%
- chemgreek%
- }%
-}
-\providecommand*\chemgreek{{\scshape\textcolor{main}{chemgreek}}\xspace}
+ \def\Code##1{\item\code{##1}\hfill\newline}%
+ \cnltxlist
+ }
+ {\endcnltxlist}
\renewcommand*\AmS{\hologo{AmS}}
+\newcommand*\TikZ{Ti\textit{k}Z}
+
\newcommand*\tablehead[1]{\textrm{\bfseries#1}}
\begin{document}
@@ -297,224 +266,234 @@ systems in different countries. While it has not been implemented by all
countries yet~\cite{unece:ghsystem_implementation}, it is only a matter of
time.
-The package \ghsystem now enables you to typeset all the hazard and
+The package \ghsystem\ now enables you to typeset all the hazard and
precautionary statements and pictograms in a very easy way. The statements
are taken from \acs{eu} regulation 1272/2008~\cite{eu:ghsystem_regulation}.
\section{Licence and Requirements}
-Permission is granted to copy, distribute and/or modify this software under
-the terms of the \LaTeX\ project public license (lppl) version 1.3 or later
-(\url{http://www.latex-project.org/lppl.txt}). The package has the status
-``maintained.''
+\license
\ghsystem\ loads the following packages:
-\paket*{expl3}\footnote{\CTANurl{l3kernel}}, \paket*{xparse} and
-\paket*{l3keys2e}\footnote{\CTANurl{l3packages}}, \paket*{translations} (from
-the \paket{exsheets} bundle), \paket{siunitx}, \paket{graphicx},
-\paket{longtable} and \paket{ifpdf}.
+\pkg{expl3}\footnote{\CTANurl{l3kernel}}~\cite{bnd:l3kernel}, \pkg{xparse} and
+\pkg{l3keys2e}\footnote{\CTANurl{l3packages}}~\cite{bnd:l3packages},
+\needpackage{translations}~\cite{pkg:translations},
+\needpackage{siunitx}~\cite{pkg:siunitx},
+\needpackage{graphicx}~\cite{pkg:graphicx},
+\needpackage{longtable}~\cite{pkg:longtable} and
+\needpackage{ifpdf}~\cite{pkg:ifpdf}.
\section{Setup}
The simplest way is to load \chemmacros\ which loads \ghsystem\ implicitily.
-All of \ghsystem's options belong to the module
-\textcolor{module}{\code{ghsystem}}. This means they can be setup with
-\begin{beispiel}[code only]
- \chemsetup[ghsystem]{<options>} or
- \chemsetup{ghsystem/<option1>,ghsystem/<option2>}
-\end{beispiel}
+All of \ghsystem's options belong to the module \module{ghsystem}. This means
+they can be setup with
+\begin{sourcecode}
+ \chemsetup[ghsystem]{<options>} or
+ \chemsetup{ghsystem/<option1>,ghsystem/<option2>}
+\end{sourcecode}
\sinceversion{4.0}However, \ghsystem\ can be loaded as a standalone package
and thus provides its own setup command:
-\begin{beschreibung}
- \Befehl{ghssystem}{<options>}
-\end{beschreibung}
+\begin{commands}
+ \command{ghssetup}[\marg{options}]
+ Setup command for \ghsystem.
+\end{commands}
-\section{Get Hazard and Precautionary Statements}\secidx{Hazard and Precautionary Statements}
-\subsection{Simple Statements}\secidx[get statements]{GHSYSTEM}
+\section{Get Hazard and Precautionary Statements}
+\subsection{Simple Statements}
The general usage is simple: you use the command
-\begin{beschreibung}
- \Befehl{ghs}*[<options>]{<type>}\ma{<number>}
-\end{beschreibung}
+\begin{commands}
+ \command{ghs}[\sarg\oarg{options}\marg{type}\marg{number}]
+ Get statement number \meta{number} of type \meta{type}.
+\end{commands}
There are three types available: \code{h}, \code{euh} and \code{p}. The
-\ma{<type>} argument is case insensitive, so just type them in as you like.
-\begin{beispiel}
- \ghs{h}{200} \\
- \ghs{H}{224} \\
- \ghs{euh}{001} \\
- \ghs{Euh}{202} \\
- \ghs{p}{201}
-\end{beispiel}
+\meta{type} argument is case insensitive, so just type them in as you like.
+\begin{example}[side-by-side]
+ \ghs{h}{200} \par
+ \ghs{H}{224} \par
+ \ghs{euh}{001} \par
+ \ghs{Euh}{202} \par
+ \ghs{p}{201}
+\end{example}
The starred version hides the identifier and only gives the statement. If you
want to hide the statement itself instead you can use the option:
-\begin{beschreibung}
- \Option{hide}{\default{true}|false}\Default{false}
- Hide the statement.
-\end{beschreibung}
+\begin{options}
+ \keybool{hide}\Default{false}
+ Hide the statement.
+\end{options}
There is an option to customize the output, too.
-\begin{beschreibung}
- \Option{space}{<space command>}\Default{}
- Space between \code{<type>} and \code{<number>}.
-\end{beschreibung}
-\begin{beispiel}
- \ghs{h}{200} \\
- \ghs[space=\,]{h}{200} \\
- \ghs*{h}{200} \\
- \ghs[hide]{h}{200}
-\end{beispiel}
-
-\subsection{Statements with Placeholders}\secidx[statements with placeholders]{GHSYSTEM}
+\begin{options}
+ \keyval{space}{space command}\Default
+ Space between \meta{type} and \meta{number}.
+\end{options}
+\begin{example}[side-by-side]
+ \ghs{h}{200} \par
+ \ghs[space=\,]{h}{200} \par
+ \ghs*{h}{200} \par
+ \ghs[hide]{h}{200}
+\end{example}
+
+\subsection{Statements with Placeholders}
Some of the statements contain placeholders. They can be one of the
following:
\begin{itemize}
- \item \textit{\textless state route of exposure if it is conclusively proven that
- no other routes of exposure cause the hazard\textgreater}
- \item \textit{\textless state specific effect if known\textgreater}
- \item \textit{\textless or state all organs affected, if known\textgreater}
- \item \textit{\textless name of sensitising substance\textgreater}
+ \item \textit{\textless state route of exposure if it is conclusively proven
+ that no other routes of exposure cause the hazard\textgreater}
+ \item \textit{\textless state specific effect if known\textgreater}
+ \item \textit{\textless or state all organs affected, if known\textgreater}
+ \item \textit{\textless name of sensitising substance\textgreater}
\end{itemize}
Except the last one which needs to be filled in, they are hidden per default.
They can be made visible with the option
-\begin{beschreibung}
- \Option{fill-in}{\default{true}|false}\Default{false}
- Show placeholders.
-\end{beschreibung}
-\begin{beispiel}[below]
- \ghs{h}{340} \\
- \ghs[fill-in]{h}{340} \\
- \ghs{h}{360} \\
- \ghs[fill-in]{h}{360} \\
- \ghs{h}{370} \\
- \ghs[fill-in]{h}{370} \\
- \ghs{euh}{208} \\
- \ghs[fill-in]{euh}{208}
-\end{beispiel}
+\begin{options}
+ \keybool{fill-in}\Default{false}
+ Show placeholders.
+\end{options}
+\begin{example}
+ \ghs{h}{340} \par
+ \ghs[fill-in]{h}{340} \par
+ \ghs{h}{360} \par
+ \ghs[fill-in]{h}{360} \par
+ \ghs{h}{370} \par
+ \ghs[fill-in]{h}{370} \par
+ \ghs{euh}{208} \par
+ \ghs[fill-in]{euh}{208}
+\end{example}
These placeholders can be replaced with one of these options:
-\begin{beschreibung}
- \Option{exposure}{<text>}\Default{}
- exposure placeholder
- \Option{effect}{<text>}\Default{}
- effect placeholder
- \Option{organs}{<text>}\Default{}
- organ placeholder
- \Option{substance}{<text>}\Default{}
- substance placeholder
-\end{beschreibung}
-\begin{beispiel}
- \ghs[exposure=This is how you get exposed.]{h}{340} \\
- \ghs[effect=These are the effects.]{h}{360} \\
- \ghs[organs=to this organ]{h}{370} \\
- \ghs[substance=substance]{euh}{208}
-\end{beispiel}
-
-\subsection{Statements with Gaps}\secidx[statements with gaps]{GHSYSTEM}
+\begin{options}
+ \keyval{exposure}{text}\Default
+ exposure placeholder
+ \keyval{effect}{text}\Default
+ effect placeholder
+ \keyval{organs}{text}\Default
+ organ placeholder
+ \keyval{substance}{text}\Default
+ substance placeholder
+\end{options}
+\begin{example}
+ \ghs[exposure=This is how you get exposed.]{h}{340} \par
+ \ghs[effect=These are the effects.]{h}{360} \par
+ \ghs[organs=to this organ]{h}{370} \par
+ \ghs[substance=substance]{euh}{208}
+\end{example}
+
+\subsection{Statements with Gaps}
Some of the statements have gaps that can be filled.
-\begin{beispiel}
- \ghs{p}{301} \\
- \ghs{p}{401} \\
- \ghs{p}{411} \\
- \ghs{p}{413}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ghs{p}{301} \par
+ \ghs{p}{401} \par
+ \ghs{p}{411} \par
+ \ghs{p}{413}
+\end{example}
These gaps can be filled using these options:
-\begin{beschreibung}
- \Option{text}{<text>}
- \Option{dots}{<text>}
- \Option{C-temperature}{<num>}
- \Option{F-temperature}{<num>}
- \Option{kg-mass}{<num>}
- \Option{lbs-mass}{<num>}
-\end{beschreibung}
-\begin{beispiel}
- \ghs[text=contact physician!]{p}{301} \\
- \ghs[dots=here]{p}{401} \\
- \ghs[C-temperature=50, F-temperature=122]{p}{411} \\
- \ghs[kg-mass=5.0, lbs-mass=11, C-temperature=50, F-temperature=122]{p}{413}
-\end{beispiel}
-
-\subsection{Combined Statements}\secidx[combined statements]{GHSYSTEM}
+\begin{options}
+ \keyval{text}{text}
+ Fill the \code{text} gap.
+ \keyval{dots}{text}
+ Fill the \code{dots} gap.
+ \keyval{C-temperature}{num}
+ Fill the Celsius temperature gap.
+ \keyval{F-temperature}{num}
+ Fill the Fahrenheit temperature gap.
+ \keyval{kg-mass}{num}
+ Fill the \si{\GHSkilogram} mass gap.
+ \keyval{lbs-mass}{num}
+ Fill the \si{\GHSpounds} mass gap.
+\end{options}
+\begin{example}
+ \ghs[text=contact physician!]{p}{301} \par
+ \ghs[dots=here]{p}{401} \par
+ \ghs[C-temperature=50, F-temperature=122]{p}{411} \par
+ \ghs[kg-mass=5.0, lbs-mass=11, C-temperature=50, F-temperature=122]{p}{413}
+\end{example}
+
+\subsection{Combined Statements}
There are some combinations of statements. They are input with a \code{+}
between the numbers:
-\begin{beispiel}[below]
- \ghs{p}{235+410} \\
- \ghs{p}{301+330+331}
-\end{beispiel}
+\begin{example}
+ \ghs{p}{235+410} \\
+ \ghs{p}{301+330+331}
+\end{example}
Note that you can only get combinations that officially exist. \emph{You
can't combine freely}.
-\secidx*{Hazard and Precautionary Statements}
-\section{Pictograms}\secidx{Pictograms}
+\section{Pictograms}
\subsection{The Pictures}
The \ac{ghs} defines a number of pictograms:
\ghspic{explos} \ghspic{flame} \ghspic{flame-O} \ghspic{bottle} \ghspic{acid}
\ghspic{skull} \ghspic{exclam} \ghspic{health} \ghspic{aqpol}
-The command
-\begin{beschreibung}
- \Befehl{ghspic}[<options>]{<name>}
-\end{beschreibung}
-loads them. Table~\ref{tab:ghs_pictograms} shows all available pictograms and
-their names. To be more precise: it shows the names to use with the
-\cmd{ghspic} command. The file names are
-\lstinline=ghsystem_<name>.<filetype>= where \code{<filetype>} is \code{eps},
-\code{pdf}, \code{jpg} or \code{png}, see also
+\begin{commands}
+ \command{ghspic}[\oarg{options}\marg{name}]
+ Load pictogram \meta{name}.
+\end{commands}
+Table~\ref{tab:ghs_pictograms} shows all available pictograms and their names.
+To be more precise: it shows the names to use with the \cs{ghspic} command.
+The file names are \code{ghsystem\_\meta{name}.\meta{filetype}} where
+\meta{filetype} is \code{eps}, \code{pdf}, \code{jpg} or \code{png}, see also
section~\ref{ssec:picture_type}.
-\begin{beispiel}
- \ghspic{skull}
-\end{beispiel}
+\begin{example}[side-by-side]
+ \ghspic{skull}
+\end{example}
If you don't like the default size you can change it using this option:
-\begin{beschreibung}
- \Option{scale}{<factor>}\Default{1}
- Scales the pictogram.
-\end{beschreibung}
+\begin{options}
+ \keyval{scale}{factor}\Default{1}
+ Scales the pictogram.
+\end{options}
The pictures are actually quite large. The default setting scales them by a
-factor
-of $\frac{1}{20}$.
-\begin{beispiel}
- \ghspic[scale=2]{skull}
-\end{beispiel}
+factor of $\frac{1}{20}$.
+\begin{example}[side-by-side]
+ \ghspic[scale=2]{skull}
+\end{example}
-If you want to use some specific \lstinline=\includegraphics= options, \eg, if
+If you want to use some specific \cs*{includegraphics} options, \eg, if
you want to rotate the pictogram for some reason, use this option:
-\begin{beschreibung}
- \Option{includegraphics}{\{<includegraphics keyvals>\}}
-\end{beschreibung}
-\begin{beispiel}
- \ghspic[includegraphics={angle=90}]{skull}
-\end{beispiel}
+\begin{options}
+ \keyval{includegraphics}{includegraphics keyvals}
+ Pass options to the underlying \cs*{includegraphics} command.
+\end{options}
+\begin{example}
+ \ghspic[includegraphics={angle=90}]{skull}
+\end{example}
\begin{longtable}{>{\ttfamily}ll>{\ttfamily}ll}
\caption{All available \ac{ghs} pictograms.\label{tab:ghs_pictograms}} \\
\toprule
- \normalfont\bfseries name & \bfseries pictogram & \normalfont\bfseries name & \bfseries pictogram \\
+ \normalfont\bfseries name & \bfseries pictogram &
+ \normalfont\bfseries name & \bfseries pictogram \\
\midrule\endfirsthead
\toprule
- \normalfont\bfseries name & \bfseries pictogram & \normalfont\bfseries name & \bfseries pictogram \\
+ \normalfont\bfseries name & \bfseries pictogram &
+ \normalfont\bfseries name & \bfseries pictogram \\
\midrule\endhead
\bottomrule\endfoot
- explos & \ghspic{explos} & explos-1 & \ghspic{explos-1} \\
- explos-2 & \ghspic{explos-2} & explos-3 & \ghspic{explos-3} \\
- explos-4 & \ghspic{explos-4} & explos-5 & \ghspic{explos-5} \\
- explos-6 & \ghspic{explos-6} & & \\
- flame & \ghspic{flame} & flame-2-white & \ghspic{flame-2-white} \\
- flame-2-black & \ghspic{flame-2-black} & flame-3-white & \ghspic{flame-3-white} \\
- flame-3-black & \ghspic{flame-3-black} & flame-4-1 & \ghspic{flame-4-1} \\
- flame-4-2 & \ghspic{flame-4-2} & flame-4-3-white & \ghspic{flame-4-3-white} \\
- flame-4-3-black & \ghspic{flame-4-3-black} & flame-5-2-white & \ghspic{flame-5-2-white} \\
- flame-5-2-black & \ghspic{flame-5-2-black} & & \\
- flame-O & \ghspic{flame-O} & flame-O-5-1 & \ghspic{flame-O-5-1} \\
- bottle & \ghspic{bottle} & bottle-2-black & \ghspic{bottle-2-white} \\
- bottle-2-white & \ghspic{bottle-2-black} & & \\
- acid & \ghspic{acid} & acid-8 & \ghspic{acid-8} \\
- skull & \ghspic{skull} & skull-2 & \ghspic{skull-2} \\
- skull-6 & \ghspic{skull-6} & & \\
- exclam & \ghspic{exclam} & & \\
- health & \ghspic{health} & & \\
- aqpol & \ghspic{aqpol} & & \\
+ explos & \ghspic{explos} & explos-1 & \ghspic{explos-1} \\
+ explos-2 & \ghspic{explos-2} & explos-3 & \ghspic{explos-3} \\
+ explos-4 & \ghspic{explos-4} & explos-5 & \ghspic{explos-5} \\
+ explos-6 & \ghspic{explos-6} & & \\
+ flame & \ghspic{flame} & flame-2-white & \ghspic{flame-2-white} \\
+ flame-2-black & \ghspic{flame-2-black} & flame-3-white & \ghspic{flame-3-white} \\
+ flame-3-black & \ghspic{flame-3-black} & flame-4-1 & \ghspic{flame-4-1} \\
+ flame-4-2 & \ghspic{flame-4-2} &
+ flame-4-3-white & \ghspic{flame-4-3-white} \\
+ flame-4-3-black & \ghspic{flame-4-3-black} &
+ flame-5-2-white & \ghspic{flame-5-2-white} \\
+ flame-5-2-black & \ghspic{flame-5-2-black} & & \\
+ flame-O & \ghspic{flame-O} & flame-O-5-1 & \ghspic{flame-O-5-1} \\
+ bottle & \ghspic{bottle} & bottle-2-black & \ghspic{bottle-2-white} \\
+ bottle-2-white & \ghspic{bottle-2-black} & & \\
+ acid & \ghspic{acid} & acid-8 & \ghspic{acid-8} \\
+ skull & \ghspic{skull} & skull-2 & \ghspic{skull-2} \\
+ skull-6 & \ghspic{skull-6} & & \\
+ exclam & \ghspic{exclam} & & \\
+ health & \ghspic{health} & & \\
+ aqpol & \ghspic{aqpol} & & \\
\end{longtable}
\subsection{Picture Type Depending on Engine}\label{ssec:picture_type}
@@ -527,37 +506,40 @@ directory the pictures are saved in.
However, the latter can include \code{jpg} and \code{png} without any
problems, while \pdfTeX{} in \acs{dvi} mode can't.
-To resolve this \ghsystem tests which engine is used and if \pdfTeX{} which
+To resolve this \ghsystem\ tests which engine is used and if \pdfTeX{} which
mode is used and then chooses either \code{eps} or \code{pdf} for the
pictograms. You are free to choose the picture type yourself with the option
-\begin{beschreibung}
- \Option{pic-type}{eps|pdf|jpg|png}
-\end{beschreibung}
-\secidx*{Pictograms}
+\begin{options}
+ \keychoice{pic-type}{eps,pdf,jpg,png}
+ Choose the picture type.
+\end{options}
\section{Available Languages}\label{sec:ghsystem_language}
Right now the H and P statements are only available in English, German or
-Italian. The package adapts \chemmacros' option \key[option]{language} or if
-the option hasn't been used recognizes the language settings made with
-\paket{babel} or \paket{polyglossia}. To be more precise: the language
-selected at begin document is recognized. Later changes won't affect
-\ghsystem. If you want to use different languages you have to use
-\ghsystem's language option then.
+Italian. The package adapts \chemmacros' option \option{language} or if the
+option hasn't been used recognizes the language settings made with \pkg{babel}
+or \pkg{polyglossia}. To be more precise: the language selected at begin
+document is recognized. Later changes won't affect \ghsystem. If you want to
+use different languages you have to use \ghsystem's language option then.
You can also choose the language explicitly.
-\begin{beschreibung}
- \Option{language}{english|german|italian}\Default{english}
- Selects and loads language file. Falls back to \code{english} if the
- chosen file doesn't exist.
-\end{beschreibung}
-\begin{beispiel}
- \ghs{h}{201}
-
- \chemsetup[ghsystem]{language=german}
- \ghs{h}{201}
-\end{beispiel}
-
-% TODO: \loadghsystemlanguage
+\begin{options}
+ \keychoice{language}{english,german,italian}\Default{english}
+ Selects and loads language file. Falls back to \code{english} if the
+ chosen file doesn't exist.
+\end{options}
+\begin{example}[side-by-side]
+ \ghs{h}{201}
+
+ \chemsetup[ghsystem]{language=german}
+ \ghs{h}{201}
+\end{example}
+
+There is another alternative:
+\begin{commands}
+ \command{loadghsystemlanguage}[\marg{language}]
+ \sinceversion{4.0}Load the language used by \ghsystem.
+\end{commands}
I will add other languages some time in future. This may take a while,
though. If you would be willing to contribute and write the statements of
@@ -566,55 +548,50 @@ me\footnote{\href{mailto:contact@mychemistry.eu}{contact@mychemistry.eu}}. I
would provide you with a template file, a \acs{pdf} containing the official
translations, and help to all your questions.
-\section{List of All Statements}\secidx{List of All Statements}
+\section{List of All Statements}
If for some reason you want to list all sentences you can use
-\begin{beschreibung}
- \Befehl{ghslistall}[<options>]
-\end{beschreibung}
-
-This command has a number of options to customize the table, which is created with
-the \lstinline=longtable= environment of the \paket{longtable} package.
-\begin{beschreibung}
- \Option{table-head-number}{<text>}\Default{Identifier}
- \Option{table-head-text}{<text>}\Default{Statement}
- \Option{table-next-page}{<text>}\Default{continues on next page}
- \Option{table-caption}{<text>}\Default{All H, EUH, and P Statements.}
- As \code{<text>} in \lstinline=\caption{<text>}=.
- \Option{table-caption-short}{<text>}\Default{}
- As \code{<short>} in \lstinline=\caption[<short>]{<text>}=.
- \Option{table-label}{<text>}\Default{tab:ghs-hp-statements}
- The label to refer to the table with \lstinline=\ref= and similar
- commands.
- \Option{table-row-sep}{<dim>}\Default{3pt}
- The separation of the table rows. A \TeX\ dimension.
- \Option{table-rules}{\default{default}|booktabs|none}\Default{default}
- The style of the horizontal rules in the table. \code{default} uses
- \lstinline=\hline=, \code{booktabs} uses \lstinline=\toprule=,
- \lstinline=\midrule= or \lstinline=\bottomrule=, resp. This option needs
- the \paket{booktabs} package which you have to load yourself then.
- \Option{table-top-head-rule}{\default{default}|booktabs|none}\Default{default}
- Change top rule explicitly.
- \Option{table-head-rule}{\default{default}|booktabs|none}\Default{default}
- Change rule below head explicitly.
- \Option{table-foot-rule}{\default{default}|booktabs|none}\Default{default}
- Change foot rule explicitly.
- \Option{table-last-foot-rule}{\default{default}|booktabs|none}\Default{default}
- Change last foot rule explicitly.
-\end{beschreibung}
+\begin{commands}
+ \command{ghslistall}[\oarg{options}]
+ Print a table with all defined statements.
+\end{commands}
+
+This command has a number of options to customize the table, which is created
+with the \env{longtable} environment of the \pkg{longtable} package.
+\begin{options}
+ \keyval{table-head-number}{text}\Default{Identifier}
+ The table head for the number.
+ \keyval{table-head-text}{text}\Default{Statement}
+ The table head for the statement.
+ \keyval{table-next-page}{text}\Default{continues on next page}
+ The hint for a next page.
+ \keyval{table-caption}{text}\Default{All H, EUH, and P Statements.}
+ The \meta{text} in \cs*{caption}\marg{text}.
+ \keyval{table-caption-short}{short text}\Default
+ The \meta{short text} in \cs*{caption}\oarg{short text}\marg{text}.
+ \keyval{table-label}{text}\Default{tab:ghs-hp-statements}
+ The label to refer to the table with \cs*{ref} and similar commands.
+ \keyval{table-row-sep}{dim}\Default{3pt}
+ The separation of the table rows. A \TeX\ dimension.
+ \keychoice{table-rules}{\default{default},booktabs,none}\Default{default}
+ The style of the horizontal rules in the table. \code{default} uses
+ \cs*{hline}, \code{booktabs} uses \cs*{toprule}, \cs*{midrule} and
+ \cs*{bottomrule}, resp. This option needs the \pkg{booktabs} package
+ which you have to load yourself then.
+ \keychoice{table-top-head-rule}{\default{default},booktabs,none}\Default{default}
+ Change top rule explicitly.
+ \keychoice{table-head-rule}{\default{default},booktabs,none}\Default{default}
+ Change rule below head explicitly.
+ \keychoice{table-foot-rule}{\default{default},booktabs,none}\Default{default}
+ Change foot rule explicitly.
+ \keychoice{table-last-foot-rule}{\default{default},booktabs,none}\Default{default}
+ Change last foot rule explicitly.
+\end{options}
The code below shows how table~\ref{tab:ghs-hp-statements} was created:
-\begin{beispiel}[code only]
- \ghslistall[fill-in,table-rules=booktabs]
-\end{beispiel}
+\begin{sourcecode}
+ \ghslistall[fill-in,table-rules=booktabs]
+\end{sourcecode}
\ghslistall[fill-in,table-rules=booktabs]
-\secidx*{List of All Statements}
-
-\appendix
-
-\printbibliography
-
-{\catcode`\^=11 \catcode`\#=11
-\printindex}
\end{document}
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
index d041025fe17..38408cde11b 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
+++ b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
@@ -27,8 +27,8 @@
% --------------------------------------------------------------------------
\RequirePackage{ expl3 , xparse , l3keys2e , tikz , amsmath , xfrac , nicefrac , scrlfile }
\usetikzlibrary{arrows}
-\def\chemformula@version{4.1}
-\def\chemformula@date{2013/08/24}
+\def\chemformula@version{4.2}
+\def\chemformula@date{2013/10/24}
\ProvidesExplPackage
{chemformula}
@@ -208,6 +208,8 @@
\box_new:N \l__chemformula_tmpa_box
\box_new:N \l__chemformula_tmpb_box
+\seq_new:N \l__chemformula_tmpa_seq
+
% booleans:
% this one is officially used to detect wether we're in \ch or not:
\bool_new:N \l_chemformula_inside_ch_bool
@@ -287,6 +289,12 @@
\dim_set:Nn \l__chemformula_bond_dim { .5833em }
\dim_new:N \l__chemformula_bond_space_dim
\dim_set:Nn \l__chemformula_bond_space_dim { .07em }
+\dim_new:N \l__chemformula_elspec_pair_distance_dim
+\dim_set:Nn \l__chemformula_elspec_pair_distance_dim { 1ex }
+\dim_new:N \l__chemformula_elspec_pair_line_length_dim
+\dim_set:Nn \l__chemformula_elspec_pair_line_length_dim { 1.5ex }
+\dim_new:N \l__chemformula_elspec_pair_width_dim
+\dim_set:Nn \l__chemformula_elspec_pair_width_dim { 1pt }
% skips:
\skip_new:N \l__chemformula_stoich_space_skip
@@ -299,6 +307,7 @@
% integers:
\int_new:N \l__chemformula_count_tokens_int
+\int_new:N \g__chemformula_lewis_int
% token lists:
\tl_new:N \l__chemformula_arrow_ratio_tl
@@ -343,10 +352,15 @@
\tl_set:Nn \l__chemformula_subscript_shift_additional_tl { 0pt }
\tl_new:N \l__chemformula_superscript_shift_additional_tl
\tl_set:Nn \l__chemformula_superscript_shift_additional_tl { 0pt }
-\tl_new:N \l__chemformula_bond_style_tl
\tl_new:N \l__chemformula_subscript_tl
\tl_new:N \l__chemformula_superscript_tl
\tl_new:N \g__chemformula_input_up_tl
+\tl_new:N \l__chemformula_elspec_angle_tl
+\tl_new:N \l__chemformula_elspec_radius_tl
+\tl_set:Nn \l__chemformula_elspec_radius_tl { .5ex }
+\tl_new:N \l__chemformula_elspec_default_type_tl
+\tl_set:Nn \l__chemformula_elspec_default_type_tl { pair }
+\tl_const:Nx \c_chemformula_colon_tl { \token_to_str:N : }
% property lists:
\prop_new:N \l__chemformula_arrows_code_prop
@@ -356,6 +370,7 @@
\prop_new:N \l__chemformula_charge_prop
\prop_new:N \l__chemformula_numbers_prop
\prop_new:N \l__chemformula_no_stoich_prop
+\prop_new:N \l__chemformula_lewis_elspec_types_prop
% sequences:
\seq_new:N \l__chemformula_arrows_type_seq
@@ -377,6 +392,14 @@
{ \draw [ #1 ] #2 ; }
\cs_generate_variant:Nn \chemformula_draw:nn { xn,nx,xx,xf }
+\cs_new:Npn \chemformula_node:nn #1#2
+ { \node [ #1 ] { #2 } ; }
+\cs_generate_variant:Nn \chemformula_node:nn { x }
+
+\cs_new:Npn \chemformula_node:nnn #1#2#3
+ { \node [ #1 ] ( #2 ) { #3 } ; }
+\cs_generate_variant:Nn \chemformula_node:nnn { nx }
+
\cs_new:Npn \chemformula_allow_break:
{ \tex_penalty:D \c_zero }
@@ -816,54 +839,59 @@
% declare arrows in the right order
% e.g. <-> must be declared before -> in order to search & replace it first
% resonance arrow:
-\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[chemarrow,cf-cf] (cf_arrow_start) -- (cf_arrow_end) ; }
+\DeclareChemArrow { -> }
+ { \draw[chemarrow,-cf] (cf_arrow_start) -- (cf_arrow_end) ; }
+\DeclareChemArrow { <- }
+ { \draw[chemarrow,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) ;
+ \draw[chemarrow,-cf]
+ ([yshift=.2ex]cf_arrow_start) -- ([yshift=.2ex]cf_arrow_end) ;
+ \draw[chemarrow,cf-,]
+ ([yshift=-.2ex]cf_arrow_start) -- ([yshift=-.2ex]cf_arrow_end) ;
}
% isolobal arrow:
\DeclareChemArrow { <o> }
{
- \draw[cf-cf] (cf_arrow_start) -- (cf_arrow_end) ;
- \draw
+ \draw[chemarrow,cf-cf] (cf_arrow_start) -- (cf_arrow_end) ;
+ \draw[chemarrow]
(cf_arrow_mid) .. controls ++(-.9ex,-1.5ex) and
++(.9ex,-1.5ex) .. (cf_arrow_mid) ;
}
\DeclareChemArrow { <=>> }
{
- \draw[-left~cf]
+ \draw[chemarrow,-left~cf]
([yshift=.15ex]cf_arrow_start) -- ([yshift=.15ex]cf_arrow_end) ;
- \draw[left~cf-]
+ \draw[chemarrow,left~cf-]
([yshift=-.15ex]cf_arrow_mid_start) -- ([yshift=-.15ex]cf_arrow_mid_end) ;
}
\DeclareChemArrow {<<=>}
{
- \draw[-left~cf]
+ \draw[chemarrow,-left~cf]
([yshift=.15ex]cf_arrow_mid_start) -- ([yshift=.15ex]cf_arrow_mid_end) ;
- \draw[left~cf-]
+ \draw[chemarrow,left~cf-]
([yshift=-.15ex]cf_arrow_start) -- ([yshift=-.15ex]cf_arrow_end) ;
}
\DeclareChemArrow { <=> }
{
- \draw[-left~cf]
+ \draw[chemarrow,-left~cf]
([yshift=.15ex]cf_arrow_start) -- ([yshift=.15ex]cf_arrow_end) ;
- \draw[left~cf-]
+ \draw[chemarrow,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) ;
+ \draw[chemarrow,-cf] (cf_arrow_start) -- (cf_arrow_end) ;
+ \draw[chemarrow] (cf_arrow_mid) ++ (.2ex,.4ex) -- ++(-.4ex,-.8ex) ;
+ \draw[chemarrow] (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) ;
+ \draw[chemarrow,cf-] (cf_arrow_start) -- (cf_arrow_end) ;
+ \draw[chemarrow] (cf_arrow_mid) ++ (.2ex,.4ex) -- ++(-.4ex,-.8ex) ;
+ \draw[chemarrow] (cf_arrow_mid) ++ (.6ex,.4ex) -- ++(-.4ex,-.8ex) ;
}
% net reaction:
\DeclareChemArrow { == } { \node at ([yshift=-.2ex]cf_arrow_mid) { = } ; }
@@ -880,7 +908,8 @@
compound-sep .dim_set:N = \l__chemformula_compound_sep_dim ,
arrow-style .tl_set:N = \l__chemformula_arrow_style_tl ,
label-style .tl_set:N = \l__chemformula_arrow_label_style_tl ,
- arrow-penalty .tl_set:N = \l__chemformula_arrow_penalty_tl
+ arrow-penalty .tl_set:N = \l__chemformula_arrow_penalty_tl ,
+ arrow-style .code:n = \tikzset { chemarrow/.style={#1} } ,
}
% --------------------------------------------------------------------------
@@ -915,12 +944,12 @@
\mode_if_math:TF
{
\mathchoice
- { \text { #1 } }
- { \text { #1 } }
- { \text { \scriptsize #1 } }
- { \text { \tiny #1 } }
+ { \text { \chemformula_font_inner: #1 } }
+ { \text { \chemformula_font_inner: #1 } }
+ { \text { \scriptsize \chemformula_font_inner: #1 } }
+ { \text { \tiny \chemformula_font_inner: #1 } }
}
- { #1 }
+ { \chemformula_font_inner: #1 }
}
\cs_generate_variant:Nn \chemformula_write:n { V }
@@ -1008,6 +1037,7 @@
{
\group_begin:
\keys_set:nn { chemmacros / chemformula } { #1 }
+
\chemformula_input_cmpd:nN { #2 } \l__chemformula_compound_tl
\chemformula_write:V \l__chemformula_compound_tl
\group_end:
@@ -1212,8 +1242,6 @@
\l__chemformula_tmpa_tl
}
-\tikzset { chembond/.style={butt~cap-butt~cap,\l__chemformula_bond_style_tl} }
-
\NewDocumentCommand \DeclareChemBond { mm }
{
\cs_if_exist:cTF { chemformula_bond_type_#1 }
@@ -1689,11 +1717,10 @@
{
\tl_if_blank:VF \l__chemformula_stoich_tl
{
- \tl_put_left:Nn \l__chemformula_stoich_tl { \chemformula_font_inner: }
- % TODO: is \ExplSyntaxOn needed here?
- \tl_set_rescan:Nno \l__chemformula_stoich_tl
- { \ExplSyntaxOn }
- { \l__chemformula_stoich_tl }
+ \tl_put_left:Nn \l__chemformula_stoich_tl { \q_mark }
+ \__chemformula_sanitize:NV
+ \l__chemformula_stoich_tl
+ \l__chemformula_stoich_tl
\__chemformula_parse_stoich:V
\l__chemformula_stoich_tl
}
@@ -1707,9 +1734,8 @@
{ \__chemformula_parse_stoich:w #1 \q_nil }
\cs_generate_variant:Nn \__chemformula_parse_stoich:n { V }
-\cs_new:Npn \__chemformula_parse_stoich:w \chemformula_font_inner: #1 \q_nil
+\cs_new:Npn \__chemformula_parse_stoich:w \q_mark #1 \q_nil
{
- \tl_put_right:Nn \l__chemformula_input_tl { \chemformula_font_inner: }
\__chemformula_bool_set_if_first_last:Nnnn
\l__chemformula_stoich_is_iupac_bool { #1 } { ( } { ) }
\bool_if:NTF \l__chemformula_stoich_is_iupac_bool
@@ -1834,8 +1860,6 @@
!\l__chemformula_first_last_math_bool
}
{
- \tl_put_right:Nn #2
- { \chemformula_font_inner: }
\__chemformula_handle_sub_and_superscripts:nN { #1 } #2
\bool_if:NT \l__chemformula_options_bool
{
@@ -1980,11 +2004,7 @@
\cs_new_protected:Npn \__chemformula_clean_chemmacros:n #1
{
\cs_set:Nn \chemmacros_text:n
- {
- \mode_if_math:TF
- { \text { \chemformula_font_inner: ##1 } }
- { \chemformula_font_inner: ##1 }
- }
+ { \mode_if_math:TF { \text { ##1 } } { ##1 } }
\cs_set:Npn \chemmacros_xspace: {}
}
\cs_generate_variant:Nn \__chemformula_clean_chemmacros:n { V }
@@ -2277,7 +2297,8 @@
} ,
bond-length .dim_set:N = \l__chemformula_bond_dim ,
bond-offset .dim_set:N = \l__chemformula_bond_space_dim ,
- bond-style .tl_set:N = \l__chemformula_bond_style_tl ,
+ bond-style .code:n =
+ \tikzset { chembond/.style={butt~cap-butt~cap,#1} } ,
bond-penalty .tl_set:N = \l__chemformula_bond_penalty_tl ,
font-family .code:n =
\bool_set_true:N \l__chemformula_fss_bool
@@ -2305,10 +2326,242 @@
}
% --------------------------------------------------------------------------
+% \chlewis[opions]{el spec}{atom}
+
+\keys_define:nn { chemmacros / chemformula }
+ {
+ lewis-default .tl_set:N = \l__chemformula_elspec_default_type_tl ,
+ lewis-distance .dim_set:N = \l__chemformula_elspec_pair_distance_dim ,
+ lewis-line-length .dim_set:N = \l__chemformula_elspec_pair_line_length_dim ,
+ lewis-line-width .dim_set:N = \l__chemformula_elspec_pair_width_dim ,
+ lewis-offset .tl_set:N = \l__chemformula_elspec_radius_tl
+ }
+
+% #1: options
+% #2- el spec
+% #3: atom
+\cs_new_protected:Npn \chemformula_lewis:nnn #1#2#3
+ {
+ \group_begin:
+ \keys_set:nn { chemmacros / chemformula } { #1 }
+ \int_gincr:N \g__chemformula_lewis_int
+ \chemformula_get_lewis_sequence:n { #2 }
+ \chemformula_tikz:nn { baseline }
+ {
+ \chemformula_node:nxn { anchor=base , inner~sep=0pt }
+ { chlewis-\int_use:N \g__chemformula_lewis_int }
+ {
+ \bool_if:NTF \l_chemformula_inside_ch_bool
+ { #3 }
+ { \chemformula_chcpd:nn {} { #3 } }
+ }
+ \seq_map_inline:Nn \l__chemformula_tmpa_seq
+ { \chemformula_lewis_get_angle_and_spec:n { ##1 } }
+ }
+ \group_end:
+ }
+
+\cs_new_protected:Npn \chemformula_get_lewis_sequence:n #1
+ {
+ \tl_set:Nn \l__chemformula_tmpa_tl { #1 }
+ \tl_replace_all:Nnn \l__chemformula_tmpa_tl { : } { \scan_stop: : , }
+ \tl_replace_all:NVn \l__chemformula_tmpa_tl \c_chemformula_colon_tl
+ { \scan_stop: : , }
+ \tl_replace_all:Nnn \l__chemformula_tmpa_tl { . } { \scan_stop: . , }
+ \tl_replace_all:Nnn \l__chemformula_tmpa_tl { | } { \scan_stop: | , }
+ \tl_replace_all:Nnn \l__chemformula_tmpa_tl { o } { \scan_stop: o , }
+ \seq_set_split:NnV \l__chemformula_tmpa_seq { , } \l__chemformula_tmpa_tl
+ }
+\cs_generate_variant:Nn \tl_replace_all:Nnn { NV }
+
+\cs_new:Npn \chemformula_lewis_get_angle_and_spec:n #1
+ { \__chemformula_lewis_get_angle_and_spec:w #1 \scan_stop: \scan_stop: \q_stop }
+
+\cs_new_protected:Npn
+ \__chemformula_lewis_get_angle_and_spec:w #1 \scan_stop: #2 \scan_stop: #3 \q_stop
+ {
+ \tl_if_blank:nF { #1 }
+ {
+ \tl_set:Nn \l__chemformula_elspec_angle_tl { #1 }
+ \tl_if_blank:nTF { #2 }
+ {
+ \tl_set_eq:NN
+ \l__chemformula_elspec_type_tl
+ \l__chemformula_elspec_default_type_tl
+ }
+ { \tl_set:Nn \l__chemformula_elspec_type_tl { #2 } }
+ \__chemformula_lewis_set_elspec_type:V \l__chemformula_elspec_type_tl
+ }
+ }
+
+\cs_new_protected:Npn \__chemformula_lewis_set_elspec_type:n #1
+ {
+ \prop_get:NnNT \l__chemformula_lewis_elspec_types_prop { #1 }
+ \l__chemformula_tmpa_tl
+ { \tl_use:N \l__chemformula_tmpa_tl }
+ }
+\cs_generate_variant:Nn \__chemformula_lewis_set_elspec_type:n { V }
+
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { | }
+ { \__chemformula_lewis_elspec_pair_line: }
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { : }
+ { \__chemformula_lewis_elspec_pair_dots: }
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { . }
+ { \__chemformula_lewis_elspec_single: }
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { o }
+ { \__chemformula_lewis_elspec_empty: }
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { pair }
+ { \__chemformula_lewis_elspec_pair_dots: }
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { pair~(dotted) }
+ { \__chemformula_lewis_elspec_pair_dots: }
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { pair~(line) }
+ { \__chemformula_lewis_elspec_pair_line: }
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { single }
+ { \__chemformula_lewis_elspec_single: }
+\prop_put:Nnn \l__chemformula_lewis_elspec_types_prop { empty }
+ { \__chemformula_lewis_elspec_empty: }
+
+\cs_new_protected:Npn \__chemformula_lewis_elspec_pair_dots:
+ {
+ \chemformula_draw:nn { fill }
+ {
+ (node~cs \c_chemformula_colon_tl
+ name = chlewis-\int_use:N \g__chemformula_lewis_int ,
+ angle = \l__chemformula_elspec_angle_tl
+ )
+ ++
+ (
+ \l__chemformula_elspec_angle_tl
+ \c_chemformula_colon_tl
+ \l__chemformula_elspec_radius_tl
+ )
+ ++
+ (
+ \l__chemformula_elspec_angle_tl +90
+ \c_chemformula_colon_tl
+ .5\l__chemformula_elspec_pair_distance_dim
+ )
+ circle (\l__chemformula_radical_radius_dim)
+ ++
+ (
+ \l__chemformula_elspec_angle_tl -90
+ \c_chemformula_colon_tl
+ \l__chemformula_elspec_pair_distance_dim
+ )
+ circle (\l__chemformula_radical_radius_dim)
+ }
+ }
+
+\cs_new_protected:Npn \__chemformula_lewis_elspec_pair_line:
+ {
+ \chemformula_draw:nn
+ { line~width = \l__chemformula_elspec_pair_width_dim }
+ {
+ (node~cs \c_chemformula_colon_tl
+ name = chlewis-\int_use:N \g__chemformula_lewis_int ,
+ angle = \l__chemformula_elspec_angle_tl
+ )
+ ++
+ (
+ \l__chemformula_elspec_angle_tl
+ \c_chemformula_colon_tl
+ \l__chemformula_elspec_radius_tl
+ )
+ ++
+ (
+ \l__chemformula_elspec_angle_tl +90
+ \c_chemformula_colon_tl
+ .5\l__chemformula_elspec_pair_line_length_dim
+ )
+ --
+ ++
+ (
+ \l__chemformula_elspec_angle_tl -90
+ \c_chemformula_colon_tl
+ \l__chemformula_elspec_pair_line_length_dim
+ )
+ }
+ }
+
+\cs_new_protected:Npn \__chemformula_lewis_elspec_single:
+ {
+ \chemformula_draw:nn { fill }
+ {
+ (node~cs \c_chemformula_colon_tl
+ name = chlewis-\int_use:N \g__chemformula_lewis_int ,
+ angle = \l__chemformula_elspec_angle_tl
+ )
+ ++
+ (
+ \l__chemformula_elspec_angle_tl
+ \c_chemformula_colon_tl
+ \l__chemformula_elspec_radius_tl
+ )
+ circle (\l__chemformula_radical_radius_dim)
+ }
+ }
+
+\cs_new_protected:Npn \__chemformula_lewis_elspec_empty:
+ {
+ \chemformula_draw:nn { }
+ {
+ (node~cs \c_chemformula_colon_tl
+ name = chlewis-\int_use:N \g__chemformula_lewis_int ,
+ angle = \l__chemformula_elspec_angle_tl
+ )
+ ++
+ (
+ \l__chemformula_elspec_angle_tl
+ \c_chemformula_colon_tl
+ \l__chemformula_elspec_radius_tl
+ )
+ ++
+ (
+ \l__chemformula_elspec_angle_tl +90
+ \c_chemformula_colon_tl
+ .5\l__chemformula_elspec_pair_line_length_dim
+ )
+ coordinate (chlewis-tmp1)
+ ++
+ (
+ \l__chemformula_elspec_angle_tl -90
+ \c_chemformula_colon_tl
+ \l__chemformula_elspec_pair_line_length_dim
+ )
+ coordinate (chlewis-tmp2)
+ ++
+ (
+ \l__chemformula_elspec_angle_tl
+ \c_chemformula_colon_tl
+ .25\l__chemformula_elspec_pair_line_length_dim
+ )
+ coordinate (chlewis-tmp3)
+ ++
+ (
+ \l__chemformula_elspec_angle_tl +90
+ \c_chemformula_colon_tl
+ \l__chemformula_elspec_pair_line_length_dim
+ )
+ coordinate (chlewis-tmp4)
+ (chlewis-tmp1) -- (chlewis-tmp2) --
+ (chlewis-tmp3) -- (chlewis-tmp4) --
+ cycle
+ }
+ }
+
+\NewDocumentCommand\chlewis{O{}mm}
+ { \chemformula_lewis:nnn { #1 } { #2 } { #3 } }
+
+% --------------------------------------------------------------------------
\NewDocumentCommand \setchemformula { m }
{ \keys_set:nn { chemmacros / chemformula } { #1 } }
+\setchemformula{
+ bond-style = {} ,
+ arrow-style = {}
+}
+
% --------------------------------------------------------------------------
% hyperref support
\AfterPackage* { hyperref }
@@ -2319,6 +2572,7 @@
\cs_set:Npn \charrow #1 { #1 }
\cs_set:Npn \chname (#1)(#2) { #2~(#1) }
\cs_set:Npn \ch #1 { #1 }
+ \cs_set:Npn \chlewis #1#2 { #2 }
}
}
@@ -2431,13 +2685,16 @@ VERSION HISTORY
reference
- new option `tikz-external-disable'
- new option `frac-math-cmd'
+2013/10/24 - version 4.2 - \chemformula_font_inner: is only applied /once/ to
+ a formula, and at the beginning, fixes
+ https://bitbucket.org/cgnieder/chemmacros/issue/23
+ - fixed wrong setting of the TikZ bond style
+ - new option `arrow-style'
+ - new command \chlewis
% --------------------------------------------------------------------------
% TODO
-- add \tikzexternaldisable and an option to disable it to \ch, \chcpd,
- \charrow, and \bond
+- https://bitbucket.org/cgnieder/chemmacros/issue/23/
- Addukte: Zahlen nach * und . automatisch erkennen?
-- optionale Argumente von \\ nach außen weiterreichen?
-- zu `frac-style' die Möglichkeit einbauen, statt \frac, \dfrac oder \tfrac zu
- verwenden.
+- optionale Argumente von \\ nach außen
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
index 26cb76ea4ab..3b99d33eb9b 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
+++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
@@ -26,8 +26,8 @@
% - The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
\RequirePackage{ expl3 , xparse , l3keys2e }
-\def\chemmacros@version{4.1}
-\def\chemmacros@date{2013/08/24}
+\def\chemmacros@version{4.2}
+\def\chemmacros@date{2013/10/28}
\ProvidesExplPackage
{chemmacros}
@@ -55,6 +55,8 @@
\cs_generate_variant:Nn \prop_put:Nnn { NV , NVx }
\cs_generate_variant:Nn \prop_get:NnNTF { NV }
\cs_generate_variant:Nn \tl_set_rescan:Nnn { NnV }
+\cs_generate_variant:Nn \tl_if_eq:nnTF { V }
+\cs_generate_variant:Nn \tl_const:cn { cV }
% --------------------------------------------------------------------------
% load required packages
@@ -127,6 +129,13 @@
{ \msg_warning:nnxx { #1 } { #2 } { #3 } { #4 } }
}
+\cs_new_protected:Npn \chemmacros_msg:nn #1#2
+ {
+ \bool_if:NTF \l_chemmacros_strict_bool
+ { \msg_error:nn { #1 } { #2 } }
+ { \msg_warning:nn { #1 } { #2 } }
+ }
+
\cs_new_protected:Npn \chemmacros_warning:nnxx #1#2#3#4
{
\bool_if:NTF \l_chemmacros_strict_bool
@@ -296,28 +305,35 @@
properly~ \msg_line_context: .
}
-\msg_new:nnnn { chemmacros } { DeclareChemState }
+\msg_new:nnnn { chemmacros } { declare-state }
{
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 \RenewChemState
- \c_space_tl to~ alter~ it.
+ \c_space_tl to~ alter~ it~ \msg_line_context: .
}
{
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 \RenewChemState
- \c_space_tl to~ alter~ it.
+ \c_space_tl to~ alter~ it~ \msg_line_context: .
}
-\msg_new:nnnn { chemmacros } { RenewChemState }
+\msg_new:nnnn { chemmacros } { renew-state }
{
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
- \DeclareChemState \c_space_tl to~ create~ it.
+ \DeclareChemState \c_space_tl to~ create~ it~ \msg_line_context: .
}
{
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
- \DeclareChemState \c_space_tl to~ create ~it.
+ \DeclareChemState \c_space_tl to~ create ~it~ \msg_line_context: .
+ }
+
+\msg_new:nnn { chemmacros } { state-syntax }
+ {
+ You're~ using~ a~ no~ longer~ recommended~ syntax~ to~ (re-)define~ a~
+ state~ variable~ \msg_line_context: .~ This~ syntax~ may~ deprecate~ and~
+ be~ removed~ in~ the~ future.
}
% declare an option as deprecated:
@@ -614,6 +630,13 @@
\cs_new:Npn \chemmacros_remove_backslash:N #1
{ \exp_after:wN \use_none:n \token_to_str:N #1 }
+\prg_new_conditional:Npnn \chemmacros_if_is_cs:n #1 { T,F,TF }
+ {
+ \tl_set:Nx \l__chemmacros_tmpa_tl { \token_if_cs:NTF #1 { } { x } }
+ \tl_if_blank:VTF \l__chemmacros_tmpa_tl
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
% detection and handling of bold face:
\prg_new_conditional:Npnn \chemmacros_if_bold: { T,F,TF }
@@ -909,10 +932,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 } } } }
+ { \chlewis { 0: } { #1 } }
+ { \chlewis { 0| } { #1 } }
+% { { \chemmacros_inner_font: #1 \chlewis { 0=| } { \vphantom { #1 } } } }
}
{
\chemmacros_msg:nnxx { chemmacros } { chemfig } { #1 } {}
@@ -1038,10 +1060,11 @@
\protected\def\chemmacros@sconf#1%
{%
\begingroup
- \tikz[baseline=(a.base),text height=1.5ex,text depth=.25ex]
+ \tikz[baseline,text height=1.5ex,text depth=.25ex]
{
- \node(a) {#1} ;
- \draw[->,thick,rotate=90] ($(a.center)+(20:.8em)$) arc (20:340:.8em);
+ \node[anchor=base] (chemmacros@@Sconf) {#1} ;
+ \draw[->,thick,rotate=90]
+ ($(chemmacros@@Sconf.center)+(20:.8em)$) arc (20:340:.8em);
}%
\endgroup
}
@@ -1049,10 +1072,11 @@
\protected\def\chemmacros@rconf#1%
{%
\begingroup
- \tikz[baseline=(a.base),text height=1.5ex,text depth=.25ex]
+ \tikz[baseline,text height=1.5ex,text depth=.25ex]
{
- \node(a) {#1} ;
- \draw[<-,thick,rotate=90] ($(a.center)+(20:.8em)$) arc (20:340:.8em) ;
+ \node[anchor=base] (chemmacros@@Rconf) {#1} ;
+ \draw[<-,thick,rotate=90]
+ ($(chemmacros@@Rconf.center)+(20:.8em)$) arc (20:340:.8em) ;
}%
\endgroup
}
@@ -2337,18 +2361,10 @@
}
\NewDocumentCommand \DeclareChemPhase { mom }
- {
- \IfNoValueTF { #2 }
- { \chemmacros_declare_phase:Nn #1 { #3 } }
- { \chemmacros_declare_phase:Nn #1 { #3 } }
- }
+ { \chemmacros_declare_phase:Nn #1 { #3 } }
\NewDocumentCommand \RenewChemPhase { mom }
- {
- \IfNoValueTF { #2 }
- { \chemmacros_renew_phase:Nn #1 { #3 } }
- { \chemmacros_renew_phase:Nn #1 { #3 } }
- }
+ { \chemmacros_renew_phase:Nn #1 { #3 } }
\cs_new_protected:Npn \__chemmacros_define_phase:Nn #1#2
{
@@ -2620,10 +2636,13 @@
}
}
+\cs_new_protected:Npn \changestate
+ { \mathop{} \! \ChemDelta }
+
% --------------------------------------------------------------------------
% \State
\tl_new:N \l__chemmacros_State_delta_tl
-\tl_set:Nn \l__chemmacros_State_delta_tl { \Delta }
+\tl_set:Nn \l__chemmacros_State_delta_tl { \changestate }
\tl_new:N \l__chemmacros_State_exponent_tl
\tl_set:Nn \l__chemmacros_State_exponent_tl { \standardstate }
@@ -2667,8 +2686,7 @@
\cs_new_protected:Npn \chemmacros_state:nnn #1#2#3
{
\group_begin:
- \IfNoValueF { #1 }
- { \keys_set:nn { chemmacros / state } { #1 } }
+ \keys_set:nn { chemmacros / state } { #1 }
\ensuremath
{
\bool_if:NT \l__chemmacros_State_delta_bool
@@ -2683,11 +2701,11 @@
}
\group_end:
}
-\cs_generate_variant:Nn \chemmacros_state:nnn { fnn,xnn }
+\cs_generate_variant:Nn \chemmacros_state:nnn { xnV }
\bool_if:NF \l__chemmacros_version_one_bool
{
- \NewDocumentCommand \State { s o m G{} }
+ \NewDocumentCommand \State { s O{} m G{} }
{
\group_begin:
\IfBooleanT { #1 }
@@ -2711,7 +2729,7 @@
\tl_set:Nn \l__chemmacros_thermod_exponent_default_tl { \standardstate }
\tl_new:N \l__chemmacros_thermod_delta_tl
\tl_new:N \l__chemmacros_thermod_delta_default_tl
-\tl_set:Nn \l__chemmacros_thermod_delta_default_tl { \Delta }
+\tl_set:Nn \l__chemmacros_thermod_delta_default_tl { \changestate }
\bool_new:N \l__chemmacros_renewstate_bool
@@ -2738,25 +2756,31 @@
\l__chemmacros_thermod_delta_default_tl
}
-% \DeclareChemState[<keyval>]{<name>}{<symbol>}{<unit>}
\bool_if:NF \l__chemmacros_version_one_bool
{
- \cs_new_protected:Npn \DeclareChemState
+ % \DeclareChemState{<name>}[<keyval>]{<symbol>}{<unit>}
+ \NewDocumentCommand \DeclareChemState { omO{}mm }
{
\bool_set_false:N \l__chemmacros_renewstate_bool
\__chemmacros_setnewstate_reset:
- \peek_meaning:NTF [
- { \__chemmacros_setnewstate:n }
- { \__chemmacros_setnewstate_aux:nnn }
+ \IfNoValueTF { #1 }
+ { \chemmacros_define_state:nnnn { #3 } { #2 } { #4 } { #5 } }
+ {
+ \chemmacros_msg:nn { chemmacros } { state-syntax }
+ \chemmacros_define_state:nnnn { #1#3 } { #2 } { #4 } { #5 }
+ }
}
-% \RenewChemState[<keyval>]{<name>}{<symbol>}{<unit>}
- \cs_new_protected:Npn \RenewChemState
+ % \RenewChemState{<name>}[<keyval>]{<symbol>}{<unit>}
+ \NewDocumentCommand \RenewChemState { omO{}mm }
{
\bool_set_true:N \l__chemmacros_renewstate_bool
\__chemmacros_setnewstate_reset:
- \peek_meaning:NTF [
- { \__chemmacros_setnewstate:n }
- { \__chemmacros_setnewstate_aux:nnn }
+ \IfNoValueTF { #1 }
+ { \chemmacros_define_state:nnnn { #3 } { #2 } { #4 } { #5 } }
+ {
+ \chemmacros_msg:nn { chemmacros } { state-syntax }
+ \chemmacros_define_state:nnnn { #1#3 } { #2 } { #4 } { #5 }
+ }
}
\cs_set_protected:Npn \setnewstate
{
@@ -2777,27 +2801,32 @@
\tl_set:Nn \l__chemmacros_thermod_subscript_left_default_tl { true }
\tl_clear:N \l__chemmacros_thermod_subscript_default_tl
\tl_set:Nn \l__chemmacros_thermod_exponent_default_tl { \standardstate }
- \tl_set:Nn \l__chemmacros_thermod_delta_default_tl { \Delta }
+ \tl_set:Nn \l__chemmacros_thermod_delta_default_tl { \changestate }
}
-\cs_new_protected:Npn \__chemmacros_setnewstate:n [#1]
+\cs_new_protected:Npn \chemmacros_define_state:nnnn #1#2#3#4
{
\keys_set:nn { chemmacros / setnewstate } { #1 }
- \__chemmacros_setnewstate_aux:nnn
+ \chemmacros_if_is_cs:nTF { #2 }
+ { \__chemmacros_set_state:xnn { \cs_to_str:N #2 } { #3 } { #4 } }
+ {
+ \chemmacros_msg:nn { chemmacros } { state-syntax }
+ \__chemmacros_set_state:nnn { #2 } { #3 } { #4 }
+ }
}
-\cs_new_protected:Npn \__chemmacros_setnewstate_aux:nnn #1#2#3
+\cs_new_protected:Npn \__chemmacros_set_state:nnn #1#2#3
{
\bool_if:NTF \l__chemmacros_renewstate_bool
{
\cs_if_exist:cF { #1 }
- { \msg_error:nnx { chemmacros } { renewstate } { #1 } }
+ { \msg_error:nnx { chemmacros } { renew-state } { #1 } }
\cs_undefine:c {chemmacros_ #1 _reset: }
- \cs_undefine:c { l__chemmacros_ #1 _subscript_tl }
- \cs_undefine:c { l__chemmacros_ #1 _exponent_tl }
- \cs_undefine:c { l__chemmacros_ #1 _delta_tl }
- \cs_undefine:c { l__chemmacros_ #1 _left_tl }
- \cs_undefine:c { l__chemmacros_ #1 _unit_tl }
+ \cs_undefine:c { c__chemmacros_ #1 _subscript_tl }
+ \cs_undefine:c { c__chemmacros_ #1 _exponent_tl }
+ \cs_undefine:c { c__chemmacros_ #1 _delta_tl }
+ \cs_undefine:c { c__chemmacros_ #1 _left_tl }
+ \cs_undefine:c { c__chemmacros_ #1 _unit_tl }
\cs_undefine:c { #1 }
\cs_undefine:c { #1 _aux_i:n }
\cs_undefine:c { #1 _aux_ii:n }
@@ -2805,41 +2834,41 @@
}
{
\cs_if_exist:cT { #1 }
- { \msg_error:nnx { chemmacros } { setnewstate } { #1 } }
+ { \msg_error:nnx { chemmacros } { declare-state } { #1 } }
}
\group_begin:
- \exp_args:Nnf \tl_const:cn
- { l__chemmacros_ #1 _subscript_tl }
- { \tl_use:N \l__chemmacros_thermod_subscript_default_tl }
- \exp_args:Nnf \tl_const:cn
- { l__chemmacros_ #1 _exponent_tl }
- { \tl_use:N \l__chemmacros_thermod_exponent_default_tl }
- \exp_args:Nnf \tl_const:cn
- { l__chemmacros_ #1 _delta_tl }
- { \tl_use:N \l__chemmacros_thermod_delta_default_tl }
- \exp_args:Nnf \tl_const:cn
- { l__chemmacros_ #1 _left_tl }
- { \tl_use:N \l__chemmacros_thermod_subscript_left_default_tl }
+ \tl_const:cV
+ { c__chemmacros_ #1 _subscript_tl }
+ \l__chemmacros_thermod_subscript_default_tl
+ \tl_const:cV
+ { c__chemmacros_ #1 _exponent_tl }
+ \l__chemmacros_thermod_exponent_default_tl
+ \tl_const:cV
+ { c__chemmacros_ #1 _delta_tl }
+ \l__chemmacros_thermod_delta_default_tl
+ \tl_const:cV
+ { c__chemmacros_ #1 _left_tl }
+ \l__chemmacros_thermod_subscript_left_default_tl
\tl_const:cn
- { l__chemmacros_ #1 _unit_tl }
+ { c__chemmacros_ #1 _unit_tl }
{ #3 }
\cs_new_protected:cpn {chemmacros_ #1 _reset: }
{
\tl_set_eq:Nc
\l__chemmacros_thermod_subscript_tl
- { l__chemmacros_ #1 _subscript_tl }
+ { c__chemmacros_ #1 _subscript_tl }
\tl_set_eq:Nc
\l__chemmacros_thermod_exponent_tl
- { l__chemmacros_ #1 _exponent_tl }
+ { c__chemmacros_ #1 _exponent_tl }
\tl_set_eq:Nc
\l__chemmacros_thermod_delta_tl
- { l__chemmacros_ #1 _delta_tl }
+ { c__chemmacros_ #1 _delta_tl }
\tl_set_eq:Nc
\l__chemmacros_thermod_subscript_left_tl
- { l__chemmacros_ #1 _left_tl }
+ { c__chemmacros_ #1 _left_tl }
\tl_set_eq:Nc
\l__chemmacros_thermod_unit_tl
- { l__chemmacros_ #1 _unit_tl }
+ { c__chemmacros_ #1 _unit_tl }
}
\cs_new_protected:cpn { #1 }
{
@@ -2868,48 +2897,47 @@
{
\ensuremath
{
- \exp_args:Nf \tl_if_eq:nnTF
- { \tl_use:N \l__chemmacros_thermod_subscript_left_tl } { true }
+ \tl_if_eq:VnTF
+ \l__chemmacros_thermod_subscript_left_tl { true }
{
- \chemmacros_state:fnn
+ \chemmacros_state:xnV
{
subscript-left = true ,
exponent =
- { \tl_use:N \l__chemmacros_thermod_exponent_tl } ,
+ { \exp_not:V \l__chemmacros_thermod_exponent_tl } ,
delta =
- { \tl_use:N \l__chemmacros_thermod_delta_tl }
+ { \exp_not:V \l__chemmacros_thermod_delta_tl }
}
{ #2 }
}
{
- \chemmacros_state:fnn
+ \chemmacros_state:xnV
{
subscript-left = false ,
exponent =
- { \tl_use:N \l__chemmacros_thermod_exponent_tl } ,
+ { \exp_not:V \l__chemmacros_thermod_exponent_tl } ,
delta =
- { \tl_use:N \l__chemmacros_thermod_delta_tl }
+ { \exp_not:V \l__chemmacros_thermod_delta_tl }
}
{ #2 }
}
- { \tl_use:N \l__chemmacros_thermod_subscript_tl }
+ \l__chemmacros_thermod_subscript_tl
=
- \exp_args:Nno \SI { ##1 } { \l__chemmacros_thermod_unit_tl }
+ \exp_args:NnV \SI { ##1 } \l__chemmacros_thermod_unit_tl
}
}
\group_end:
\ignorespaces
}
+\cs_generate_variant:Nn \__chemmacros_set_state:nnn { x }
% predefined:
\bool_if:NF \l__chemmacros_version_one_bool
{
- \DeclareChemState {Enthalpy}
- {H} {\kilo\joule\per\mole}
- \DeclareChemState [ delta=false, subscript-left=false ] {Entropy}
+ \DeclareChemState \Enthalpy {H} {\kilo\joule\per\mole}
+ \DeclareChemState \Entropy [ delta=false, subscript-left=false ]
{S} {\joule\per\kelvin\per\mole}
- \DeclareChemState {Gibbs}
- {G} {\kilo\joule\per\mole}
+ \DeclareChemState \Gibbs {G} {\kilo\joule\per\mole}
}
% --------------------------------------------------------------------------
@@ -3732,7 +3760,7 @@
\NewDocumentCommand \chemsetup { o m }
{
\IfNoValueTF { #1 }
- { \keys_set:nn { chemmacros } { #2 } }
+ { \keys_set:nn { chemmacros } { #2 } }
{
\bool_if:NTF \l__chemmacros_version_four_bool
{
@@ -3757,29 +3785,15 @@
{
\pdfstringdefDisableCommands
{
- \cs_set:Npn \- { - }% myabe not a good idea...
+ % \cs_set:Npn \- { - } % maybe not a good idea...
\cs_set:Npn \| { }
\cs_set:Npn \pH { pH }
\cs_set:Npn \pOH { pOH }
\cs_set:Npn \iupac #1 { #1 }
- % \cs_set:Npn \a { alpha }
- % \cs_set:Npn \g { gamma }
- % \cs_set:Npn \d { delta }
- % \cs_set:Npn \m { mu }
- % \cs_set:Npn \n { eta }
- % \cs_set:Npn \w { omega }
- % \cs_set:Npn \N { N }
- % \cs_set:Npn \O { O }
- % \cs_set:Npn \Sf { S }
- % \cs_set:Npn \P { P }
- % \cs_set:Npn \R { (R) }
\cs_set:Npn \cip #1 { (#1) }
- % \cs_set:Npn \E { (E) }
- % \cs_set:Npn \Z { (Z) }
\cs_set:Npn \cis { cis }
\cs_set:Npn \trans { trans }
\cs_set:Npn \tert { tert }
- % \cs_set:Npn \D { D }
\cs_set:Npn \ortho { o }
\cs_set:Npn \meta { m }
\cs_set:Npn \para { p }
@@ -4020,6 +4034,14 @@ Version history
see http://tex.stackexchange.com/q/128792/5049 and
http://tex.stackexchange.com/q/118467/5049 for
reference
+2013/10/28 - version 4.2 - changed particles with electron pairs to use
+ \chlewis
+ - changed \Delta in thermodynamic state variables
+ into \ChemDelta for IUPAC compliance and defined
+ it as an operator
+ - change in the syntax of \DeclareChemState and
+ \RenewChemState and improved both internal
+ definition and user interface
% --------------------------------------------------------------------------- %
% TODO: