summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-13 21:25:05 +0000
committerKarl Berry <karl@freefriends.org>2022-02-13 21:25:05 +0000
commit1fa5dc712fe904b27fd05f80c8bc268c400b31ad (patch)
tree67997ab0659ca438c5266691fc88d42753c65ab6 /Master/texmf-dist
parentf995d7165ff0cd3b9450cd268ec8d81826e623d4 (diff)
chemmacros (13feb22)
git-svn-id: svn://tug.org/texlive/trunk@62004 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/HISTORY448
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/README12
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdfbin998610 -> 1017922 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex327
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty1104
5 files changed, 1267 insertions, 624 deletions
diff --git a/Master/texmf-dist/doc/latex/chemmacros/HISTORY b/Master/texmf-dist/doc/latex/chemmacros/HISTORY
new file mode 100644
index 00000000000..bad8cce61ad
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemmacros/HISTORY
@@ -0,0 +1,448 @@
+--------------------------------------------------------------------------
+the CHEMMACROS package
+
+ comprehensive support for typesetting chemistry documents
+
+--------------------------------------------------------------------------
+Web: https://github.org/cgnieder/chemmacros/
+E-Mail: clemens@cnltx.de
+--------------------------------------------------------------------------
+If you have any ideas, questions, suggestions or bugs to report, please
+feel free to contact us.
+--------------------------------------------------------------------------
+Copyright 2011--2021 Clemens Niederberger
+ 2022-- Clemens Niederberger & Sonja K.
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c
+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 2008/05/04 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainers of this work are Clemens Niederberger and Sonja K.
+--------------------------------------------------------------------------
+Version history
+2011/05/15 - version 1.0 - CTAN release
+2011/06/22 - version 1.1 - "LaTeXified" whole package for safer usage
+ - less user work required (like loading package
+ after another)
+ - more particle macros
+ - latin phrases
+ - extra units
+ - acid/base commands
+ - \mech
+ - \NMR
+ - \mhName, \setmhName, \newreaction, phases
+ - \renewstate, \setstatesubscript
+ - improved orbitals
+ - simpler package options, option german, bpchem
+ - bug fixes
+2011/10/28 - version 2.0 - rewritten in expl3
+ - customization via \chemsetup
+ - new commands \p, \fplus, \fminus, \fpch, \fmch,
+ \fscrp, \fsrcm, \fdelp, \fdelm, \orbital, \chemsetup
+ - various commands have a new syntax
+ - removed: \setmhName, \setredoxdist,
+ \setstatesubscript, \porb, \phorb, \pxorb, \pyorb,
+ \pzorb, \setorbheight, \solid, \liquid
+ - reaction environments work with hyperref and
+ varioref
+2011/11/03 - version 2.0a - minor bug fixes
+ - new feature for \Nu
+ - new command \ba
+2012/01/28 - version 3.0 - bundled with packages `formula' and `ghs'
+ - new commands \Ka, \Kb, \Kw
+ - commands can detect if font series is bold
+ - new package option "detect-bold"
+ - new package option "method" => choose between
+ `mhchem' and `formula' for internal uses.
+ - new package option "ghs" => load `ghs' or don't
+ - new package option "synchronize"
+ - new package option "strict"
+ - new command \iupac
+ - new command \listofreactions, reaction environments
+ with optional argument
+ - \cis, \trans, \tert without \xspace
+2012/01/30 - version 3.0a - bugfix in formula.sty
+ - renamed formula => chemformula
+ and ghs => ghsystem to make the names unique
+ (following a request by Karl Berry for TeXlive)
+2012/02/03 - version 3.0b - new command \DeclareChemParticle, updated
+ documentation
+2012/02/05 - version 3.0c - renamed pictogram files (following a request by
+ Karl Berry for TeXlive)
+ - new package option "Nu"
+2012/02/10 - version 3.0d - several bugfixes in chemformula
+ - bugfixes with \DeclareChemParticle
+ - new command \RenewChemParticle
+ - new option phases / pos
+ - new commands \DeclareChemPhase, \RenewChemPhase,
+ \phase
+ - changed default behaviour of phases
+ - removed optional argument from \sld and \lqd
+ - new arrow type <>
+2012/02/19 - version 3.1 - new commands \DeclareChemIUPAC and \RenewChemIUPAC
+ - new option "option/iupac"
+ - deprecated option: "option/EZ"
+ - deprecated commands:
+ \newreaction => \DeclareChemReaction
+ \setnewstate => \DeclareChemState
+ \renewstate => \RenewChemState
+ \Rcip => \R
+ \Scip => \S
+ \Dfi => \D
+ \Lfi => \L
+ - new arrow types -/>, </- and <o>
+ - new commands \DeclareChemArrow, \RenewChemArrow and
+ \ShowChemArrow
+2012/02/26 - version 3.1a - "operator" p rewritten to follow IUPAC
+ recommendations
+ - new option "acid-base/p-style"
+ - deprecated option: "option/detect-bold"
+2012/03/03 - version 3.1b - arrow types are stored in a sequence to automate the
+ search and replace in the right order
+ - new arrow type ==
+ - IUPAC compliance for stoichiometric factors
+ - new handling of super- and subscripts to correct
+ various flaws: clear distinction between isotope and
+ formula
+ - new option charge-vshift
+ - IUPAC compliance for \Delta and \ox
+2012/03/14 - version 3.1c - compatibility with KOMA's global option
+ "version = <value>"
+ - bugfix in the list of reactions
+ - improved arrow labels
+2012/03/20 - version 3.2 - new: option input via @{<options>}
+ - improved list of reactions: resetting the "reaction"
+ counter now doesn't cause errors any more
+ - \AddRxnDesc added which allows to add descriptions
+ to each reaction in the "reactions" environment
+2012/05/07 - version 3.3 - new environment `experimental' that allows some
+ formatting for the for displaying of measurement
+ results
+ - more greek letters for the \iupac command
+ - \ch now bypasses \ref{}, \label{}, and \intertext{}
+ - small adjustments of the iupac commands \| and \-
+ - bug fix: option `upgreek' is now working and was
+ renamed to `greek'
+ - proper language support
+2012/05/13 - version 3.3a - Italian translations of the H, EUH and P statements
+ - \hapto and \bridge
+2012/05/18 - version 3.3b - compatibility with MiKTeX
+2012/05/18 - version 3.3c - fix in the `ghsystem/language' option
+2012/07/24 - version 3.3d - additional picture file type `pdf'
+ - default bond length set to 1.1667ex
+ - bug fix in the bonds
+ - added kerning to cip commands, new option
+ `iupac/cip-kern'
+ - bug fix: messages needed to be defined before the
+ options
+2012/08/21 - version 3.3e - new option ox/align=center|right
+ - a new option to \NMR and to \J
+2012/09/11 - version 3.4 - cleaned a little, minor bug fixes
+ - switched to internal scratch variables
+ - new command \bond, more bond types
+ - new commands \DeclareChemBond, \DeclareChemBondAlias,
+ \RenewChemBond and \ShowChemBond
+ - radical point thicker, new options `radical-style'
+ and `radical-radius'
+2012/10/03 - version 3.4a - bug fix in coupling constant \J
+2013/01/04 - version 3.4b - bug fix in the sub- and superscript handling
+2013/01/28 - version 3.5 - disallow breaks at bonds
+ - allow breaks after arrows
+ - made some spaces in chemformulas stretch- and
+ shrinkable
+ - various internal code improvements
+ - changed defaults for horizontal spaces that have in
+ set in ex into corresponding values in em.
+ - improvements to the placement of sub- and superscripts
+2013/02/19 - version 3.5a - bug fix: `ghsystem' recognizes language again
+2013/02/26 - version 3.6 - support for use with the `breqn' package
+ - chemformula: math escaping also via \(\)
+ - chemformula internal: clearer escaping macros
+ - new options: `radical-vshift', `radical-hshift'
+ and `radical-space'
+ - bug fix: `radical-...' options are now correctly set
+ - stoichiometric factors: add leading 0 if missing
+ - new option: `stoich-paren-parse'
+ - internal changes: be way more rigid about protected
+ and expandable macros
+ - internal changes: clearer distinction between
+ private macros and accessable module macros
+ - internal changes: clearer distinction between
+ document commands and module level commands
+ - chemformula's !()() syntax now also works with babel's
+ French
+2013/02/27 - version 3.6a - bug fix: escaped text and math stays escaped, i.e.
+ also arrow code like `<=>'
+2013/04/19 - version 3.6b - chemformula: new key `arrow-min-length'
+ - bug fix: stoichiometric fractions correctly displayed
+ - changed appearance of \cip to use upright parentheses
+2013/07/06 - version 4.0 - `chemformula' doesn't automatically load
+ `chemmacros' any more but can be used stand-alone
+ - option `bpchem' has been dropped
+ - improved detection of bold font series
+ - changed wrongly used \mbox in definition of \Ka,
+ \Kb and \Kw into \ensuremath
+ - adapt \mch and \pch to match `chemformula's
+ charges
+ - dropped option `method=mhchem'
+ - support for `kpfonts' and `newtxmath' upright
+ greek letters added, greek alphabet complete both
+ for uppercase and lowercase; this is handled by
+ the new package in the family: `chemgreek'
+ - \OX and \redox now work in `amsmath's environment
+ by ignoring the measuring phase
+ - language management with the help of the
+ `translations' package =>
+ recognize document language automatically and use
+ it if it a) is known to `chemmacros' and b) has
+ not been overwritten by the `language' option;
+ this also made minor changes to `ghsystem'
+ necessary; additionally this lead to changes in
+ the way phases are defined
+ - status of \Dfi and \Lfi changed from `deprecated'
+ to `dropped'
+ - new option `charges/partial-format'
+ - fixed wrongly written contents to the lor when
+ used together with `hyperref'
+ - new option `reaction/list-heading'
+ - option `charges/append' deprecated
+2013/08/07 - version 4.0a - extra pair of braces in definition of
+ \standardstate
+ - added missing \exp_not:n to the definitions of
+ \chemmacros_declare_phase:Nn and kin
+2013/08/24 - version 4.1 - changed `0' values in TikZ coordinates into `0pt'
+ 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
+2013/10/31 - version 4.2a - bug bix in \hapto and \bridge
+2013/11/04 - version 4.2b - new IUPAC commands: \fac/\mer
+2013/11/20 - version 4.2c - step bundle version due to changes in `chemgreek'
+2013/12/15 - version 4.2d - small changes to the translating mechansim which
+ now seems to be more logical: `language=auto'
+ detects the current `babel' language and
+ `language=<lang>' overwrites to the chosen
+ language
+ - new options `acid-base/K-acid', `acid-base/K-base'
+ and `acid-base/K-water'
+ - adapt \ox to updates in `l3fp'
+2014/01/09 - version 4.2e - step bundle version due to changes in `ghsystem'
+2014/01/24 - version 4.3 - \NewChemIUPAC, \LetChemIUPAC
+ - \NewChemParticle
+ - \NewChemNMR
+ - \NewChemPhase
+ - \NewChemReaction, \RenewChemReaction
+ - \NewChemState
+ - added macro names with more meaningfule names to
+ each of the one-letter name commands
+ - changed behaviour of \DeclareChem to match
+ \DeclareRobustCommand, i.e., no check if command
+ is defined; added a \NewChem variant to each that
+ /does/ check; use \NewChem instead of \DeclareChem
+ for definitions
+ - new iupac command \dento
+ - new option choice `nmr/pos=super'
+ - bug fix in appearance of coupling nuclei
+ - new possibilities for formatting the output of the
+ NMR coupling constants output with \J:
+ `coupling-pos=side/sub', `coupling-nuclei-pre',
+ coupling-nuclei-post', `coupling-bonds-pre',
+ coupling-bonds-post', `coupling-symbol'
+ - internal changes to the greek letter mapping
+ selection mechanism
+ - deprecate package option `strict'
+ - deprecate package option `cmversion': also all
+ backwards compatibility for version 1 has been
+ dropped
+ - drop command \mhName
+2014/01/29 - version 4.4 - bug fix in the display of the coupling constant
+ - bug fix in phase definitions (need to adapt to
+ changes in `translations'
+ - new option `nmr/atom-number-cs'
+ - new option `nmr/coupling-pos-cs'
+2014/04/08 - version 4.5 - new option `acid-base/subscript'
+ - added Dutch translations
+2014/06/30 - version 4.5a - adapt to deprecated expl3 functions
+2014/08/08 - version 4.6 - from bundle to packages: packages `chemformula',
+ `ghsystem' and `chemgreek' no longer belong to the
+ bundle but now are packages of their own.
+2015/02/08 - version 4.7 - fix \iupac so active letters like | still work
+ inside other macros (\section, ...)
+ - Change the default subscripts of the equilibrium
+ constants to match the usage in the IUPAC Green
+ Book
+ - allow \NewChemPhase and friends after \begin{document}
+ - new optional argument to phase commands
+ - new options `nmr/method' and `nmr/connector'
+2015/09/11 - version 5.0 - the former chemmacros.sty is now chemmacros4.sty
+ and can be loaded through the `compatibility'
+ option
+ - chemmacros is now organized in separate modules
+ which either are preloaded or can be loaded by the
+ user with \usechemmodule
+ - various changes, see
+ http://www.mychemistry.eu/2015/06/chemmacros-development/
+ and the manual section 3.4. Upgrading from version
+ < 5.0 for details
+2015/09/23 - version 5.1 - add option `method' to `chemformula' module
+ - make module `scheme' compatible with `floatrow'
+ - add module hooks `before' and `after'
+2015/10/14 - version 5.2 - warn if compatibility version requested is higher
+ than the current version number
+ - enable to specify a minimal compatibility version
+ for a module
+ - add info message to `all' module
+ - add values `newest' and `latest' to the
+ compatibility option
+ - check for mhchem and chemformula and choose the
+ formula method accordingly
+ - fixes in the module hook mechanism
+ - fix in \chemmacros_if_module_loaded:n
+ - new internal module `errorcheck'
+2016/01/13 - version 5.3 - removed options `german' and `ngerman' (lang)
+ - remove deprecated pre-v5 macros (several modules)
+ - new option `atom-number-space' (spectroscopy)
+ - add \chemprime and ' shorthand (nomenclature)
+ - new option `space' (particles)
+ - TikZ decoration `wave' (tikz)
+2016/01/23 - version 5.3a - compatibility with chemscheme package (scheme)
+ - IUPAC shorthands only defined within \iupac
+ (nomenclature)
+2016/02/10 - version 5.4 - \NewChemEqConstant and family, new option
+ `eq-constant' (acid-base)
+ - added \ignorespacesafterend to environments
+ (reactions)
+ - fixed erroneous definition of \NewChemMacroset
+ (base)
+ - new option `explicit-zero-sign' (redox)
+2016/03/08 - version 5.5 - new module `polymers'
+2016/05/02 - version 5.6 - generalization of the formula method concept, new
+ methods `chemist' and `chemfig' (chemformula)
+ - use `tocbasic' for the list of reactions if
+ available (reactions)
+ - fix reaction environments to obey \thereaction
+ (reactions)
+ - add cleveref and fancyref support (reactions)
+ - add cleveref and fancyref support (scheme)
+ - \DeclareChemTranslation and
+ \DeclareChemTranslations
+ - moved translations from lang module to the
+ corresponding modules they belong to
+2016/05/04 - version 5.6a - fix small but annoying bugs (base and chemformula)
+2016/06/07 - version 5.7 - \iupac gets an optional argument for setting
+ options (nomenclature)
+ - \latin always defined by chemmacros (nomenclature)
+ - fix conflict with `achemso' (nomenclature)
+ - allow `chemscheme'/`chemstyle' to be loaded after
+ chemmacros (errorcheck)
+ - translation keys get internal prefix (translations)
+2016/06/08 - version 5.7a - rename functions which erroneously were assigned
+ to the `chemformula' module
+ - correct wrong dates in module files
+2016/10/05 - version 5.7b - small improvement of the errorcheck module
+2016/12/28 - version 5.7c - bug fix: typo in \chemmacros_tex_if:nnTF usage
+ (scheme)
+2017/04/17 - version 5.8 - new option `nmr-base-format' (spectroscopy)
+ - change \hapto and \dento to follow iupacs rules
+ according to IUPAC Red Book 2005. IR-10.2.5.2 The
+ eta convention (p.216) and IR-9.2.4.2 The
+ kappa convention (p.155f) (nomenclature)
+ - fix error in \chemmacros_allow_hyphens: definition
+ (nomenclature)
+ - new options `cip-inner-format', `cip-outer-format'
+ and `cip-number-format' (nomenclature)
+2017/06/13 - version 5.8a - changes to compatibility test: it now works also
+ for subreleases
+ - change behaviour of \ChemCompatibilityTo and
+ \ChemCompatibilityBetween in order to cope with
+ the changed compatibility test; adapt all files
+ reflecting those changes
+ - change behaviour of
+ \__chemmacros_break_point_insert:nnn so it does
+ nothing as last token in \iupac (nomenclature)
+2017/08/28 - version 5.8b - fix missing hyperref check
+2018/03/02 - version 5.8c - fix bug in \chemmacros_p:n (acid/base)
+ - smash sub- and superscripts of polymer delimiters
+ (polymers)
+2019/09/23 - version 5.8d - add some Norwegian translations (reactions, scheme)
+2019/09/27 - version 5.8e - change `O{}' argument of reactions into `!O{}'
+ (reactions)
+2019/09/30 - version 5.8f - fix bug introduced in the last version
+2019/11/17 - version 5.9 - correction: torr -> Torr (units)
+ - define latin phrases on the go instead of at begin
+ document
+2020/01/16 - version 5.9a - adapt to renaming of string case changing functions
+2020/02/03 - version 5.10 - define \torr as well as \Torr (units)
+ - prefer lazy boolean evaluation
+ - prefer the kernel commands to
+ \chemmacros_leave_vmode: and \chemmacros_tex_if:
+2020/03/07 - version 5.11 - let \chemmacros_iupac:nn think we're in the
+ document – fixes issue #30 (nomenclature)
+ - add option redox/format (redox)
+2020/03/07 - version 5.11a - fix issue #34 (spectroscopy)
+ - fix issue #41 (scheme)
+2022/01/16 - version 6.0 - merge modules into on file
+ - drop compatibility mode
+ - add reactants module and welcome Sonja K. to the
+ maintenance team
+ - fix issue #42
+ - use LaTeX's new hook mechanism
+ - get rid of scrlfile dependency
+ - update to l3text
+ - rename \Torr -> \torr (units)
+ - new iupac command \normal
+ - resolve issue #45
+ - adapt to siunitx 3.0, implement units that have
+ been removed from siunitx (units)
+ - Danish translations
+ - new `translations' module, move all translation
+ declarations there
+2022/01/18 - version 6.0a - fix issue #46
+ - fix bug related to package option `modules='
+2022/02/13 - version 6.1 - extend syntax of \state command (thermodynamics)
+ - add `reactants' module to the `errorcheck' module
+ - fix bug in Danish translation
+ - rename module `chemformula' > `formula'
+ - put reactions in the `chemfig' method in between
+ \schemestart and \schemestop (formula)
+ - replace deprecated \Lewis with \Charge in method
+ `chemfig' (formula)
+ - choose the formula method if either `mhchem' or
+ `chemformula' are loaded; choose `chemformula' if
+ there is a conflict (formula)
+ - use last instead of first found method for
+ defining floats (scheme)
+ - new option `scheme/float-method' (schemes}
+ - new option `reactions/own-counter' (reactions)
+ - new oprion `reactions/autoref-name' (reactions)
+ - deprecate option `reactions/tocbasic' (reactions)
+ - make \autoref work with reaction environments
+ through some possibly dangerous patches
+ (reactions)
+ - fix support for cleveref and fancyref with
+ reactions (reactions)
+ - reorganization of deprecation, removal, and
+ patching
+ - rename `nomenclature/format' into
+ `nomenclature/latin-format' (nomenclature)
+ - new option `nomenclature/iupac-format'
+ (nomenclature)
+ - properly implement and document user modules
+ (i.e., styles) as opposed to chemmacros' own
+ modules; since v6 \ChemModule has a new function
+ which is why \ChemStyle is introduced
+ - add load-time option `stop' which can prevent
+ modules and styles from being loaded
diff --git a/Master/texmf-dist/doc/latex/chemmacros/README b/Master/texmf-dist/doc/latex/chemmacros/README
index fa7047a4a34..6434c4135a3 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/README
+++ b/Master/texmf-dist/doc/latex/chemmacros/README
@@ -1,26 +1,26 @@
--------------------------------------------------------------------------
-the CHEMMACROS package v6.0a 2022/01/18
+the CHEMMACROS package v6.1 2022/02/13
comprehensive support for typesetting chemistry documents
--------------------------------------------------------------------------
-Clemens Niederberger
Web: https://github.com/cgnieder/chemmacros/
-E-Mail: contact@mychemistry.eu
+E-Mail: clemens@cnltx.de
--------------------------------------------------------------------------
-Copyright 2011--2022 Clemens Niederberger
+Copyright 2011--2021 Clemens Niederberger
+ 2022-- Clemens Niederberger & Sonja K.
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
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
+and version 1.3c or later is part of all distributions of LaTeX
version 2008/05/04 or later.
This work has the LPPL maintenance status `maintained'.
-The Current Maintainer of this work is Clemens Niederberger.
+The Current Maintainers of this work are Clemens Niederberger and Sonja K.
--------------------------------------------------------------------------
The chemmacros package consists of the following files
== STYLE FILES ==
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdf
index 516e7cf6f2d..b23770c8184 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdf
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex
index 3504f8cfa85..c099679864e 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex
@@ -1,35 +1,34 @@
-% arara: pdflatex: { interaction: nonstopmode }
-% arara: biber
-% arara: pdflatex: { interaction: nonstopmode }
-% arara: pdflatex: { interaction: nonstopmode }
% --------------------------------------------------------------------------
-% the CHEMMACROS package
+% the CHEMMACROS package v6.1 2022/02/13
%
% comprehensive support for typesetting chemistry documents
%
% --------------------------------------------------------------------------
-% Clemens Niederberger
-% --------------------------------------------------------------------------
-% https://github.com/cgnieder/chemmacros/
-% contact@mychemistry.eu
+% Web: https://github.org/cgnieder/chemmacros/
+% E-Mail: chemmacros@cnltx.de
% --------------------------------------------------------------------------
% If you have any ideas, questions, suggestions or bugs to report, please
-% feel free to contact me.
+% feel free to contact us.
% --------------------------------------------------------------------------
-% Copyright 2011--2022 Clemens Niederberger
+% Copyright 2011--2021 Clemens Niederberger
+% 2022-- Clemens Niederberger & Sonja K.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% 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
+% and version 1.3c or later is part of all distributions of LaTeX
% version 2008/05/04 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
-% The Current Maintainer of this work is Clemens Niederberger.
+% The Current Maintainers of this work are Clemens Niederberger and Sonja K.
% --------------------------------------------------------------------------
+% arara: pdflatex: { interaction: nonstopmode }
+% arara: biber
+% arara: pdflatex: { interaction: nonstopmode }
+% arara: pdflatex: { interaction: nonstopmode }
\documentclass{chemmacros-manual}
\usepackage[T1]{fontenc}
@@ -95,24 +94,24 @@
urldate = {2012-03-20} ,
date = {2012-03-20}
}
-@online{mychemistry:chemmacros-dev,
+@online{cnltx:chemmacros-dev,
author = {Clemens Niederberger} ,
title = {chemmacros development} ,
- url = {http://www.mychemistry.eu/2015/06/chemmacros-development/} ,
+ url = {http://www.cnltx.de/2015/06/chemmacros-development/} ,
urldate = {2015-07-16} ,
date = {2015-06-14}
}
-@online{mychemistry:modular-chemmacros,
+@online{cnltx:modular-chemmacros,
author = {Clemens Niederberger} ,
title = {modular chemmacros} ,
- url = {http://www.mychemistry.eu/2015/06/modular-chemmacros/} ,
+ url = {http://www.cnltx.de/2015/06/modular-chemmacros/} ,
urldate = {2015-07-16} ,
date = {2015-06-08}
}
-@online{mychemistry:chemmacros-update-how,
+@online{cnltx:chemmacros-update-how,
author = {Clemens Niederberger} ,
title = {a new chemmacros -- but how?} ,
- url = {http://www.mychemistry.eu/2015/07/a-new-chemmacros-but-how/} ,
+ url = {http://www.cnltx.de/2015/07/a-new-chemmacros-but-how/} ,
urldate = {2015-07-16} ,
date = {2015-07-15}
}
@@ -196,18 +195,21 @@ Since version~6.0 the different modules of \chemmacros\ are divided into three
groups:
\begin{enumerate}
\item Core modules which provide underlying functionality or basic
- functionality which is not of direct interest from a user perspective but
- might be if you plan to write a module yourself (see
- section~\ref{sec:own-modules} for details).
+ functionality and which are not of direct interest from a user perspective
+ but might be if you plan to write a module yourself (see
+ section~\ref{sec:own-modules} for details). These modules are described in
+ part~\ref{part:core-modules} of this manual.
\item Main modules which provide all the stuff for typesetting and which are
- always loaded.
+ always loaded. These modules are described in
+ part~\ref{part:main-modules} of this manual.
\item Additional modules which are also loaded in the default setup. They
are not loaded if \chemmacros\ is loaded with the minimal setup:
- \cs*{usepackage}\Oarg{minimal}\Marg{chemmacros}.
+ \cs*{usepackage}\Oarg{minimal}\Marg{chemmacros}. These modules are described in
+ part~\ref{part:additional-modules} of this manual.
\end{enumerate}
\subsection{\chemmacros' Options}\label{sec:using-chemm-opti}
-Prior to v5.0 \chemmacros\ had quite a number of package options.
+Prior to v5.0 \chemmacros\ had quite a number of load-time options.
\chemmacros\ v6.0 has only two:
\begin{options}
\keybool{minimal}\Default{false}
@@ -216,7 +218,7 @@ Prior to v5.0 \chemmacros\ had quite a number of package options.
When \option{minimal} is used this option allows to load additional
modules.
\end{options}
-These are load-time option that only can be used in the optional argument of
+These options only can be used in the optional argument of
\cs*{usepackage}. \emph{All} other of \chemmacros' options are set using the
command
\begin{commands}
@@ -275,7 +277,7 @@ descriptions and are also set without specifying a module:
Some internal modules may also define core options, \eg, the \chemmodule{lang}
module, see section~\vref{sec:lang-module}.
-\subsection{Support Package \chemformula}
+\subsection{Support Package \chemformula}\label{sec:supp-pack-chemf}
\chemformula\ provides means of typesetting chemical formulas and reactions.
You will see its macros \cs{ch} and \cs{chcpd} every now and then in this
manual. When using \chemmacros\ you can consider the \chemformula\
@@ -283,8 +285,7 @@ package~\cite{pkg:chemformula} to be loaded as \chemmacros\ makes use of it in
various places. \chemmacros\ and \chemformula\ are tightly intertwined.
Nevertheless you should be able to use the \pkg{mhchem}~\cite{pkg:mhchem}
package with \chemmacros\ without problems. Please see
-section~\vref{sec:using-mhchem} for details and \latin{caveat}s. \emph{The
- recommendation is to use \chemformula.}
+section~\vref{sec:using-mhchem} for details and \latin{caveat}s.
A historical note: \chemformula\ started as a part of \chemmacros\ in
January~2012. Since July~2013 it is a completely independent package -- from
@@ -398,7 +399,7 @@ This is how \cs{Ka} is defined:
\section{The \chemmodule*{charges} Module}\label{sec:charges-module}
-The \chemmodule{charges} module loads the module \chemmodule{chemformula}.
+The \chemmodule{charges} module loads the module \chemmodule{formula}.
\subsection{Charge Symbols}
\begin{commands}
@@ -934,7 +935,7 @@ You can change the appearance with this option:
\section{The \chemmodule*{particles} Module}\label{sec:particles-module}
The \chemmodule{particles} module loads the modules \chemmodule{charges} and
-\chemmodule{chemformula}.
+\chemmodule{formula}.
\subsection{Provided Particle Macros}
The \chemmodule{particles} defines a number of macros which can be used for
@@ -975,22 +976,22 @@ nucleophiles.
\command{NewChemParticle}[\marg{cs}\marg{formula}]
Defines a new macro \meta{cs}. \meta{formula} is any valid \chemformula\
input (this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}). Raises an error if \meta{cs} already
+ see~\vref{sec:formula-module}). Raises an error if \meta{cs} already
exists.
\command{RenewChemParticle}[\marg{cs}\marg{formula}]
Redefines a new macro \meta{cs}. \meta{formula} is any valid \chemformula\
input (this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}). Raises an error if \meta{cs} doesn't
+ see~\vref{sec:formula-module}). Raises an error if \meta{cs} doesn't
exist.
\command{DeclareChemParticle}[\marg{cs}\marg{formula}]
Defines a macro \meta{cs}. \meta{formula} is any valid \chemformula\
input (this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}). Silently overwrites \meta{cs} if it
+ see~\vref{sec:formula-module}). Silently overwrites \meta{cs} if it
exists.
\command{ProvideChemParticle}[\marg{cs}\marg{formula}]
Defines a new macro \meta{cs}. \meta{formula} is any valid \chemformula\
input (this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}). Does nothing if \meta{cs} already
+ see~\vref{sec:formula-module}). Does nothing if \meta{cs} already
exists.
\end{commands}
An example of usage is the definition of the existing particle macros:
@@ -1005,22 +1006,22 @@ The following set defines macros like \cs{Nuc}
\command{NewChemNucleophile}[\marg{cs}\marg{formula}]
Defines a new macro \meta{cs}. \meta{formula} is any valid \chemformula\
input (this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}). Note that \meta{formula} will get a
+ see~\vref{sec:formula-module}). Note that \meta{formula} will get a
trailing negative charge! Raises an error if \meta{cs} already exists.
\command{RenewChemNucleophile}[\marg{cs}\marg{formula}]
Redefines a new macro \meta{cs}. \meta{formula} is any valid \chemformula\
(this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}). Note that \meta{formula} will get a
+ see~\vref{sec:formula-module}). Note that \meta{formula} will get a
trailing negative charge! Raises an error if \meta{cs} doesn't exist.
\command{DeclareChemNucleophile}[\marg{cs}\marg{formula}]
Defines a macro \meta{cs}. \meta{formula} is any valid \chemformula\
(this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}). Note that \meta{formula} will get a
+ see~\vref{sec:formula-module}). Note that \meta{formula} will get a
trailing negative charge! Silently overwrites \meta{cs} if it exists.
\command{ProvideChemNucleophile}[\marg{cs}\marg{formula}]
Defines a new macro \meta{cs}. \meta{formula} is any valid \chemformula\
(this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}). Note that \meta{formula} will get a
+ see~\vref{sec:formula-module}). Note that \meta{formula} will get a
trailing negative charge! Does nothing if \meta{cs} already exists.
\end{commands}
An example of usage is the definition of the existing nucleophile macros:
@@ -1033,7 +1034,7 @@ A macro defined this way will have an optional argument for the
\section{The \chemmodule*{phases} Module}\label{sec:phases-module}
-The \chemmodule{phases} module loads the \chemmodule{chemformula} modul.
+The \chemmodule{phases} module loads the \chemmodule{formula} modul.
\subsection{Basics}
@@ -1145,20 +1146,21 @@ then. It loads the package \pkg{amstext}~\cite{pkg:amstext}.
\command{standardstate}
Again self-explaining: \standardstate
\command{changestate}
- The uppercase delta used in \state[superscript=]{H} for example.
+ The uppercase delta used in \state^{}{H} for example.
\end{commands}
-\section{The \chemmodule*{chemformula} Module}\label{sec:chemformula-module}
+\section{The \chemmodule*{formula} Module}\label{sec:formula-module}
-The \chemmodule{chemformula} module loads the \pkg{amstext}
+The \chemmodule{formula} module loads the \pkg{amstext}
package~\cite{pkg:amstext} and the \chemmodule{charges} module.
\subsection{For Users}
There are different packages which provide means for typesetting chemical
formulas:
\begin{itemize}
- \item \pkg{chemformula}~\cite{pkg:chemformula}. This is probably well known
- to users of \chemmacros.
+ \item \pkg{chemformula}~\cite{pkg:chemformula}. This package started as a
+ part of \chemmacros\ and thus goes naturally together with \chemmacros,
+ see also \vref{sec:supp-pack-chemf}.
\item \pkg{mhchem}~\cite{pkg:mhchem}. This is the \enquote{older brother} of
\chemformula.
\item \pkg{chemfig}~\cite{pkg:chemfig}. The easiest and most complete of the
@@ -1197,9 +1199,9 @@ you'll have to choose manually. \emph{All automatic choices only happen at the
end of the preamble}.
\subsection{Using the \pkg*{chemformula} Package}
-If you set \keyis{formula}{chemformula} the \chemmodule{chemformula} module
+If you set \keyis{formula}{chemformula} the \chemmodule{formula} module
makes it possible that you can set all \chemformula\ options via the
-\cs{chemsetup} command using the module \module{chemformula}, for example:
+\cs{chemsetup} command using the module \module{formula}, for example:
\begin{sourcecode}
\chemsetup[chemformula]{format=\sffamily}
\end{sourcecode}
@@ -1211,7 +1213,7 @@ provided by the \chemmodule{reactions} module.
\emph{This method is the recommended choice!}
\subsection{Using the \pkg*{mhchem} Package}\sinceversion{5.1}\label{sec:using-mhchem}
-If you set \keyis{formula}{mhchem} the \chemmodule{chemformula} module makes
+If you set \keyis{formula}{mhchem} the \chemmodule{formula} module makes
it possible that you can set all of \pkg{mhchem}'s options via the
\cs{chemsetup} command using the module \module{mhchem}, for example:
\begin{sourcecode}
@@ -1632,7 +1634,7 @@ implements the following macro based on the same idea:
\end{example}
\section{The \chemmodule*{reactions} Module}\label{sec:reactions-module}
-The \chemmodule{reactions} module loads the \chemmodule{chemformula} module
+The \chemmodule{reactions} module loads the \chemmodule{formula} module
and the \pkg{mathtools} package~\cite{pkg:mathtools}.
\subsection{Predefined Environments}
@@ -1644,12 +1646,12 @@ You can use these environments for numbered\ldots
environment body. A wrapper around the \env*{equation} environment. The
environment body is parsed with \cs{ch} or \cs{ce} depending on the value
of the \option{formula} option, see
- section~\vref{sec:chemformula-module}.
+ section~\vref{sec:formula-module}.
\environment{reactions}
Several aligned reactions. A wrapper around \pkg{amsmath}'s \env*{align}
environment. The environment body is parsed with \cs{ch} or \cs{ce}
depending on the value of the \option{formula} option, see
- section~\vref{sec:chemformula-module}.
+ section~\vref{sec:formula-module}.
\end{environments}
\ldots and their starred versions for unnumbered reactions.
@@ -1657,12 +1659,12 @@ You can use these environments for numbered\ldots
\environment{reaction*}
A wrapper around the \env*{equation*} environment. The environment body
is parsed with \cs{ch} or \cs{ce} depending on the value of the
- \option{formula} option, see section~\vref{sec:chemformula-module}.
+ \option{formula} option, see section~\vref{sec:formula-module}.
\environment{reactions*}
A wrapper around \pkg{amsmath}'s \env*{align*} environment. The
environment body is parsed with \cs{ch} or \cs{ce} depending on the value
of the \option{formula} option, see
- section~\vref{sec:chemformula-module}.
+ section~\vref{sec:formula-module}.
\end{environments}
With those environments you can create (un)numbered reaction equations similar
@@ -1729,6 +1731,14 @@ or use the following options:
\end{reaction}
\end{example}
+You\sinceversion{6.1} can also make reactions share a counter with math
+equations (by using the \code{equation} counter).
+\begin{options}
+ \keybool{own-counter}\Module{reactions}\Default{true}
+ If set to false the reaction environments will use the \code{equation}
+ counter instead of the \code{reaction} counter.
+\end{options}
+
The use of \AmS math's \cs{intertext} is possible:
\begin{example}
\begin{reactions}
@@ -1739,9 +1749,22 @@ The use of \AmS math's \cs{intertext} is possible:
See reaction~\ref{rxn:test}.
\end{example}
-If\sinceversion{5.6} you are using either \pkg{cleveref} or \pkg{fancyref} the
-\env{reaction} counter is supported already. For \pkg{fancyref} use the
-prefix \code{rct}.
+\subsection{Cross-Referencing}
+If\sinceversion{5.6} you are using either \pkg{cleveref}~\cite{pkg:cleveref}
+or \pkg{fancyref}~\cite{pkg:fancyref} and have set \keyis{own-counter}{true}
+the \env{reaction} counter is supported by both packages and already set up by
+\chemmacros.
+
+For \pkg{fancyref} use the prefix \code{rct} by defining the following:
+\begin{sourcecode}
+ \newcommand*\fancyrefrctlabelprefix{rct}
+\end{sourcecode}
+
+Also \pkg{hyperref}'s \cs*{autoref} is supported.
+\begin{options}
+ \keyval{autoref-name}{name}\Module{reactions}\Default{\cs*{ChemTranslate}\Marg{reaction}}
+ \sinceversion{6.1}Change the name used by \pkg{hyperref}'s \cs*{autoref}.
+\end{options}
\subsection{Own Reactions}
You can create new types of reactions with the command:
@@ -1816,14 +1839,10 @@ The output of this list can be modified by two options:
The\sinceversion{5.2} macro that is called at the beginning of the list.
Inside of \meta{code} \code{\#1} refers to the actual heading of the list.
The default setting is not entirely true: if a macro \cs*{chapter} is
- defined \code{\cs*{chapter}\sarg\Marg{\#1}} is used.
- \keybool{tocbasic}\Module{reactions}\Default{false}
- \sinceversion{5.6}If you use a \KOMAScript\ class \emph{or} if you load
- the \pkg{tocbasic} package \emph{or} if you set this option to \code{true}
- the list of reactions will be set up using the \pkg{tocbasic} package.
- This \emph{disables} the \option{list-heading-cmd} option. For a
- \KOMAScript\ class this means that the list of reactions obeys
- \KOMAScript's \option*{listof} option.
+ defined \code{\cs*{chapter}\sarg\Marg{\#1}} is used. \par
+ This command has no effect if a \KOMAScript\ class or the package
+ \pkg{tocbasic} is used. The list of reactions then obeys \KOMAScript's
+ \option*{listof} option.
\end{options}
Instead of using the option \option{list-name} you also could redefine
\cs{reactionlistname}.
@@ -1865,13 +1884,14 @@ names are declared in the preamble removing the need to repeat the same
module options the output style (order of name number and data) can be altered
globally (or locally) to suit your needs, while the data itself is input using
an easy to use key-value approach and processed by the \pkg{siunitx}
-package. The \module{reactants} module responds to the language declared with
-the \pkg{babel} package and also offers methods to integrate the acronyms of
-used reactants or solvents into the list of acronyms.
+package~\cite{pkg:siunitx}. The \module{reactants} module responds to the
+language declared with the \pkg{babel} package and also offers methods to
+integrate the acronyms of used reactants or solvents into the list of
+acronyms.
The module requires and loads the packages \pkg{chemnum}~\cite{pkg:chemnum}
-and \pkg{siunitx}~\cite{pkg:siunitx}. Depending on the selected options the
-packages \pkg{acro}~\cite{pkg:acro},
+and \pkg{siunitx}. Depending on the selected options the packages
+\pkg{acro}~\cite{pkg:acro},
\pkg{glossaries-extra}~\cite{pkg:glossaries-extra},
\pkg{hyperref}~\cite{pkg:hyperref}, \pkg{longtable}~\cite{pkg:longtable}
and/or \pkg{xltabular}~\cite{pkg:xltabular} might be needed for this module
@@ -1928,8 +1948,8 @@ Common declarations will look like this:
\cs{Reactant} can be used in order to start a sentence with an upper case
version of a compound's name. The corresponding text must be defined
through \cs{DeclareChemReactant}'s \option{upper-name} option. Further
- variants of \cs{reactant} with different suffixes, such as \code{*},
- \code{+}, \code{l}, \code{s} or \code{plain} will be described later.
+ variants of \cs{reactant} with different suffixes, such as \sarg,
+ \parg, \code{l}, \code{s} or \code{plain} will be described later.
\command{solvent}[\oarg{data and units}\marg{ID}]
Analogous to \cs{reactants}. Can be used to insert solvent names and
corresponding data in the text. Format and order depend on the on the
@@ -1979,9 +1999,9 @@ Typical uses will look like this:
which they were declared in the preamble or in an external document.
\keybool{switch}\Module{reactants}\Default{false}
While \cs{reactants} will output name and number of a reactant, its
- starred variant \cs{reactant*}, will by default result in the name without
- the corresponding number. Setting \keyis{switch}{true}, globally or
- locally, reverses this behavior and outputs a reactant's number without
+ starred variant \cs{reactant}\sarg, will by default result in the name
+ without the corresponding number. Setting \keyis{switch}{true}, globally
+ or locally, reverses this behavior and outputs a reactant's number without
its name.
\end{options}
Other options are described at later places when the corresponding behavior is
@@ -1997,7 +2017,9 @@ argument that can be used to easily input this data:
\begin{commands}
\command{reactant}[\oarg{data and units}\marg{ID}]
+ \phantom{X}\vspace*{-\baselineskip}
\command{solvent}[\oarg{data and units}\marg{ID}]
+ \phantom{X}\vspace*{-\baselineskip}
\end{commands}
\begin{table}[bp]
@@ -2011,16 +2033,16 @@ argument that can be used to easily input this data:
\toprule
\tablehead{Key} & \tablehead{default unit} & \tablehead{option} \\
\midrule
- mass & \unit{\gram} & mass-unit \\
- volume & \unit{\milli\liter} & volume-unit \\
- fraction & w/w\% & fraction-unit \\
- amount & \unit{\milli\mole} & amount-unit \\
- equiv & eq & equiv-unit \\
- purity & \% & purity-unit \\
- concentration & \unit{\Molar} & concentration-unit \\
- solvent & n.a. & \\
+ mass & \unit{\gram} & mass-unit \\
+ volume & \unit{\milli\liter} & volume-unit \\
+ fraction & w/w\% & fraction-unit \\
+ amount & \unit{\milli\mole} & amount-unit \\
+ equiv & eq & equiv-unit \\
+ purity & \% & purity-unit \\
+ concentration & \unit{\Molar} & concentration-unit \\
+ solvent & n.a. & \\
\midrule
- solution-name & solution in & solution \\
+ solution-name & solution in & solution \\
\bottomrule
\end{tabular}
\end{table}
@@ -2044,7 +2066,7 @@ solvent. This text automatically adapts to the document language set via
the German translation are included in the package. If you write in a
different language (or just don't like the predefined text), you can use the
command \cs{DeclareChemTranslation}\marg{key}\marg{language}\marg{translation}
-(with \keyis{\meta{key}}{solution}) as described in
+(with \keyis*{\meta{key}}{solution}) as described in
section~\vref{sec:lang-module} in order to supply your own translation.
\begin{example}
@@ -2159,11 +2181,11 @@ contents of the categories are typeset.
Using the \cs{reactants} command inside of section headings or captions can
mess up the order in which the molecules are numbered, especially when also
using a table of contents and/or a list of figures/tables. To prevent this,
-the \module{reactants} module offers the \code{+} suffixed variant of
-\cs{reactants}, comparable to \pkg{chemnum}'s \cs{cmpd+} command.
+the \module{reactants} module offers the \parg\ suffixed variant of
+\cs{reactants}, comparable to \pkg{chemnum}'s \cs{cmpd}\parg\ command.
\begin{commands}
- \command{reactant+}[\oarg{data and units}\marg{ID}]
+ \command{reactant}[\parg\oarg{data and units}\marg{ID}]
This command is used to insert name, number, and, if present, data of a
predefined reactant with the \meta{ID} in a section heading or caption.
\end{commands}
@@ -2241,7 +2263,7 @@ uses either \pkg{longtable} or \pkg{xltabular} to typeset this list:
are responsible for formatting the list of reactants. Be aware that with
\code{longtable}, the column widths are hard coded, thus you could
experience overfull box warnings if you use exceptionally long \meta{ID}s
- in combination with the starred variant \cs{printreactants*}, which is
+ in combination with the starred variant \cs{printreactants}\sarg, which is
responsible for adding the \meta{ID} in resulting list, as well.
\end{options}
@@ -2269,7 +2291,7 @@ The following command is provided to set oxidation numbers:
Places \meta{number} as right superscript to \meta{atom}; \meta{number}
has to be a (rational) number! \meta{atom} is treated as a \chemformula\
formula, like it would be in \cs{chcpd} (this depends on the setting of
- the \option{formula} option, see~\vref{sec:chemformula-module}).
+ the \option{formula} option, see~\vref{sec:formula-module}).
\end{commands}
\begin{example}
@@ -2476,7 +2498,7 @@ The \chemmodule{scheme} module loads the \pkg{chemnum}
package~\cite{pkg:chemnum} and defines a floating environment
\showenv{scheme}. That is, it \emph{only} defines this float if no
environment \env{scheme} exists at the end of the preamble. The module checks
-for different available float defining methods, in \emph{this} order:
+for different available float defining methods:
\begin{itemize}
\item If the current class is a \KOMAScript\ class \cs*{DeclareNewTOC} will
be used.
@@ -2491,9 +2513,19 @@ for different available float defining methods, in \emph{this} order:
\item If neither of the above the \enquote{manual} method is used. This
means the environment is defined the same way like \env*{figure} is
defined in the \cls*{article} class or the \cls*{book} class, depending if
- \cs*{chapter} is defined or not.
+ \cs*{chapter} is defined or not (the \enquote{traditional} way).
+ \item \sinceversion{6.1}If no unique choice is possible the \emph{last} of
+ the detected methods will be used. For example, if you use the
+ \cls{memoir} class \emph{and} load the \pkg{float} then the method of
+ \pkg{float} will be used.
\end{itemize}
+\begin{options}
+ \keychoice{float-method}{KOMA,memoir,tocbasic,newfloat,floatrow,float,traditional}\Module{scheme}
+ \sinceversion{6.1}You can also decide for yourself which method you want
+ \chemmacros\ to use by setting this option accordingly.
+\end{options}
+
The list name and the caption name both are translated to the language
specified according to the \option{lang} option and the provided translations,
see section~\vref{sec:lang-module} for details. If you want to manually change
@@ -2509,13 +2541,18 @@ The list of schemes is printed as expected with
\command{listofschemes}
\end{commands}
-If\sinceversion{5.6} you are using either \pkg{cleveref} or \pkg{fancyref} the
-\env{scheme} environment (or rather its captions) are supported already. For
-\pkg{fancyref} use the prefix \code{sch}.
+If\sinceversion{5.6} you are using either \pkg{cleveref}~\cite{pkg:cleveref}
+or \pkg{fancyref}~\cite{pkg:fancyref} the \env{scheme} counter is supported by
+both packages and already set up by \chemmacros.
+
+For \pkg{fancyref} use the prefix \code{sch} by defining the following:
+\begin{sourcecode}
+ \newcommand*\fancyrefschlabelprefix{sch}
+\end{sourcecode}
\section{The \chemmodule*{spectroscopy} Module}\label{sec:spectroscopy-module}
-The \chemmodule{spectroscopy} module loads the \chemmodule{chemformula} module
+The \chemmodule{spectroscopy} module loads the \chemmodule{formula} module
and the \pkg{siunitx} package~\cite{pkg:siunitx}.
\subsection{The \cs*{NMR} Command}
@@ -2535,7 +2572,7 @@ input.
\pkg{siunitx} number input, \meta{unit} is a valid \pkg{siunitx} unit
input. \meta{solvent} is any valid \chemformula\ input as in \cs{chcpd}
(this depends on the setting of the \option{formula} option,
- see~\vref{sec:chemformula-module}).
+ see~\vref{sec:formula-module}).
\end{commands}
\emph{All} Argument are optional! Without arguments we get:
@@ -2682,7 +2719,7 @@ number of options.
(printed by \cs{\#}).
\keybool{parse}\Module{spectroscopy}\Default{true}
Treat the solvent as \chemformula\ formula (this depends on the setting of
- the \option{formula} option, see~\vref{sec:chemformula-module}) or not.
+ the \option{formula} option, see~\vref{sec:formula-module}) or not.
\keyval{delta}{tokens}\Module{spectroscopy}\Default
The \meta{tokens} are added after $\delta$.
\keybool{list}\Module{spectroscopy}\Default{false}
@@ -2932,9 +2969,9 @@ package~\cite{pkg:siunitx}.
This macro can be used to write the thermodynamic state variables.
\begin{example}
- \state{A}, \state[subscript-left=f]{G} ,
- \state[subscript-right=\ch{Na}]{E},
- \state[superscript-right=\qty{1000}{\celsius}]{H}
+ \state{A}, \state_f{G} ,
+ \state{E}_{\ch{Na}},
+ \state{H}^{\qty{1000}{\celsius}}
\end{example}
These options are available:
@@ -2957,6 +2994,13 @@ These options are available:
An alias of \option{subscript-left}.
\end{options}
+Since version~6.1\sinceversion{6.1} you can input the sub- and superscripts in
+a more intuitive way instead of using the options -- the latter are still
+available, though:
+\begin{example}
+ \state_a^b{X}_c^d
+\end{example}
+
\subsection{Thermodynamic Variables}
The \chemmodule{thermodynamics} module provides a few commands for specific
@@ -3123,11 +3167,11 @@ units. Like all \pkg{siunitx} units they're only valid inside
\command{Molar} \unit{\Molar}
\command{MolMass} \unit{\MolMass}
\command{normal} \unit{\normal}
- \command{torr} \unit{\torr}
- \par
-\sinceversion{6.0} Since some units still frequently used in chemistry were removed from version 3 of \pkg{siunitx},
- \chemmacros\ also defines these in the same way, older versions of \pkg{siunitx} used to do.
- These units are:
+ \command{torr} \unit{\torr}\par
+ %%%
+ \sinceversion{6.0}Since some units still frequently used in chemistry were
+ removed from version 3 of \pkg{siunitx} \chemmacros\ also defines these in
+ the same way, older versions of \pkg{siunitx} used to do. These units are:
\command{angstrom} \unit{\angstrom}
\command{atomicmassunit} \unit{\atomicmassunit}
\command{bar} \unit{\bar}
@@ -3136,8 +3180,7 @@ units. Like all \pkg{siunitx} units they're only valid inside
\end{commands}
-\part{Core Modules}
-
+\part{Core Modules}\label{part:core-modules}
The modules described in this part are always loaded and mainly concern module
writers.
@@ -3175,7 +3218,7 @@ modules. In the macro descriptions below \TF\ denotes that a \code{T}, an
\explcommand{chemmacros_allow_break:}
Inserts a penalty of \num{0}.
\explcommand{chemmacros_skip_nobreak:N}[ \meta{skip/length variable}]
- Insert a horizontal skip where a linebreak is disallowed.
+ Inserts a horizontal skip where a linebreak is disallowed.
\expandable\explcommand{chemmacros_if_is_int:n}[\TF\ \marg{input} \marg{true}
\marg{false}]
Checks if \meta{input} is an integer or something else.
@@ -3183,7 +3226,7 @@ modules. In the macro descriptions below \TF\ denotes that a \code{T}, an
Checks if the current font weight is one of \chemboldchecks{or}.
\explcommand{chemmacros_bold:n}[ \marg{text}]
Checks if the current font weight is bold and if yes places \meta{text} in
- \cs*{textbf} if in text mode or in \cs*{bm} if in math mode. If no
+ \cs*{textbf} if in text mode or in \cs*{bm} if in math mode. If no,
\meta{text} simply is placed in the input stream as is.
\explcommand{chemmacros_text:n}[ \marg{text}]
Ensures that \meta{text} is placed in text mode.
@@ -3240,24 +3283,22 @@ This is how the macros \cs{NewChemParticle}, \cs{RenewChemParticle},
The following macros strictly speaking are not provided by the
\chemmodule{base} module but this place fits best for their description.
\begin{commands}
- \expandable\explcommand{chemmacros_if_module_exist:n}[\TF\ \marg{module}
+ \expandable\explcommand{chemmacros_module_if_exist:n}[\TF\ \marg{module}
\marg{true} \marg{false}]
Checks if a file with the correct name for a module \meta{module} can be
found.
- \expandable\explcommand{chemmacros_if_module_loaded:n}[\TF\ \marg{module}
+ \expandable\explcommand{chemmacros_module_if_loaded:n}[\TF\ \marg{module}
\marg{true} \marg{false}]
Checks if the module \meta{module} has already been loaded or not.
- \explcommand{chemmacros_load_module:n}[ \marg{module}]
- Loads module \meta{module} if it hasn't been loaded, yet.
- \explcommand{chemmacros_load_modules:n}[ \marg{csv list of modules}]
- Loads every module in \meta{csv list of modules} if they haven't been
- loaded, yet. This is the code level variant of \cs{usechemmodule}.
- \explcommand{chemmacros_before_module:nn}[ \marg{module} \marg{code}]
+ \explcommand{chemmacros_module_load:n}[ \marg{module}]
+ Loads module \meta{module} if it hasn't been loaded, yet. The module must
+ exist as a separate file as described in section~\ref{sec:own-modules}.
+ \explcommand{chemmacros_module_before:nn}[ \marg{module} \marg{code}]
Saves\sinceversion{5.1} \meta{code} and inserts it right before
\meta{module} is loaded. If \meta{module} is never loaded then
\meta{code} is never inserted. If \meta{module} already is loaded when
the command is used then \meta{code} also is never inserted.
- \explcommand{chemmacros_after_module:nn}[ \marg{module} \marg{code}]
+ \explcommand{chemmacros_module_after:nn}[ \marg{module} \marg{code}]
Saves\sinceversion{5.1} \meta{code} and inserts it right after
\meta{module} is loaded. If \meta{module} is never loaded then
\meta{code} is never inserted. If \meta{module} already is loaded when
@@ -3371,13 +3412,13 @@ following macros are available:
A token list variable that holds the language which is used by
\explcs{chemmacros_translate:n} for translation, \emph{after begin
document}.
- \command{ChemTranslate}[\marg{translation key}]
+ \expandable\command{ChemTranslate}[\marg{translation key}]
A version of \explcs{chemmacros_translate:n} for those who prefer
traditional \LaTeXe\ programming over expl3.
- \explcommand{chemmacros_declare_translation:nnn}[\marg{language}\marg{key}%
+ \explcommand{chemmacros_declare_translation:nnn}[ \marg{language} \marg{key}
\marg{translation}]
The expl3 version of \cs{DeclareChemTranslation}.
- \explcommand{chemmacros_declare_translations:nn}[\marg{key}\Marg{\meta{language}
+ \explcommand{chemmacros_declare_translations:nn}[ \marg{key} \Marg{\meta{language}
= \meta{translation}}]
The expl3 version of \cs{DeclareChemTranslations}.
\end{commands}
@@ -3507,47 +3548,42 @@ me (see section~\vref{sec:submitting-module}) so they can be added to the
\appendix
\part{Appendix}
-\section{Own Modules}\label{sec:own-modules}
+\section{Own Modules Called Styles}\label{sec:own-modules}
\subsection{How To}
If you have additional functionality which you think might be useful as a
\chemmacros\ module then you can easily write one yourself. The module must
be a file in a path where \TeX\ can find it following a certain naming
scheme. The file for a module \chemmodule*{foo} \emph{must be named}
-\code{chemmacros.module.foo.code.tex}.
+\code{chemmacros.style.foo.code.tex}.
\begin{commands}
- \command{ChemModule}[\sarg\marg{name}\marg{description}\oarg{minimal
- compatibility version}]
- Register module \meta{name}. The optional argument \meta{minimal
- compatibility version} ensures that this module is only loaded if the
- option \option{compatibility} has a high enough version number. If it is
- omitted the module can be loaded in each version~5.0 or higher.
+ \command{ChemStyle}[\sarg\marg{name}\oarg{version description}]
+ Register module \meta{name} where the optional argument is passed to the
+ optional argument of \cs*{ProvidesFile}.
\end{commands}
The first line in the file then should look similar to this:
\begin{sourcecode}
- \ChemModule{foo}{2015/07/14 description of foo}
+ \ChemStyle{foo}[2022-02-07 description of foo]
\end{sourcecode}
-This registers module \chemmodule*{foo} which means \chemmacros\ will accept
-this file as a valid module.
+This registers the style \chemmodule*{foo} which means \chemmacros\ will
+accept this file as a valid style.
+
+Such a style can then be loaded to your document via
+\begin{commands}
+ \command{usechemstyle}[\marg{csv list of style names}]
+ which should be used in the preamble of your document.
+\end{commands}
Since \chemmacros\ is written using expl3 \cs{ChemModule} starts an expl3
programming environment. If you don't want that but rather want to write your
module using traditional \LaTeXe\ methods then use the starred variant:
\begin{sourcecode}
- \ChemModule*{foo}{2015/07/14 description of foo}
+ \ChemStyle*{foo}[2022-02-07 description of foo]
\end{sourcecode}
In both variants \code{@} has category code~11 (letter).
-Since new modules very likely might rely on code provided first in a certain
-version of \chemmacros\ you might want to make sure that your module only is
-loaded when the compatibility mode is high enough to provide the features you
-want:
-\begin{sourcecode}
- \ChemModule{foo}{2015/10/14 description of foo}[5.2]
-\end{sourcecode}
-
If you decide to write your module \chemmodule*{foo} using expl3 and add
options you want to be able to set using
\cs{chemsetup}\Oarg{foo}\marg{options} please make sure you define (and set)
@@ -3608,8 +3644,9 @@ the usual support forums
\end{itemize}
You can also open an issue on
\url{https://github.com/cgnieder/chemmacros/issues/} possibly adding the label
-\emph{support}.
-
+\emph{support} or write an email to
+\href{mailto:chemmacros@cnltx.de}{chemmacros@cnltx.de}.
+
\subsection{Suggestions}
If you have any suggestions on how \chemmacros\ could be improved then please
go to \url{https://github.com/cgnieder/chemmacros/issues/} and open a new
@@ -3619,8 +3656,8 @@ issue possibly adding the label \emph{suggestion}.
If you find any bugs, \ie, errors (something not working as described,
conflicts with other packages, \ldots) then please go to
\url{https://github.com/cgnieder/chemmacros/issues/} and open a new issue
-describing the error including a minimal working example and possibly adding
-the label \emph{bug}.
+describing the error including a \emph{minimal working example} and possibly
+adding the label \emph{bug}.
\printbibliography
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
index c9a913e9223..649aed58b64 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
+++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
@@ -1,40 +1,39 @@
% --------------------------------------------------------------------------
-% the CHEMMACROS package
+% the CHEMMACROS package v6.1 2022/02/13
%
% comprehensive support for typesetting chemistry documents
%
% --------------------------------------------------------------------------
-% Clemens Niederberger
-% --------------------------------------------------------------------------
-% https://github.org/cgnieder/chemmacros/
-% contact@mychemistry.eu
+% Web: https://github.org/cgnieder/chemmacros/
+% E-Mail: chemmacros@cnltx.de
% --------------------------------------------------------------------------
% If you have any ideas, questions, suggestions or bugs to report, please
-% feel free to contact me.
+% feel free to contact us.
% --------------------------------------------------------------------------
-% Copyright 2011--2022 Clemens Niederberger
+% Copyright 2011--2021 Clemens Niederberger
+% 2022-- Clemens Niederberger & Sonja K.
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% 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.
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008/05/04 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
-% The Current Maintainer of this work is Clemens Niederberger.
+% The Current Maintainers of this work are Clemens Niederberger and Sonja K.
% --------------------------------------------------------------------------
-\RequirePackage{l3keys2e}
+\RequirePackage {l3keys2e}
\ExplSyntaxOn
% --------------------------------------------------------------------------
% package information:
-\tl_const:Nn \c_chemmacros_date_tl {2022/01/18}
+\tl_const:Nn \c_chemmacros_date_tl {2022/02/13}
\tl_const:Nn \c_chemmacros_version_major_number_tl {6}
-\tl_const:Nn \c_chemmacros_version_minor_number_tl {0}
-\tl_const:Nn \c_chemmacros_version_subrelease_tl {a}
+\tl_const:Nn \c_chemmacros_version_minor_number_tl {1}
+\tl_const:Nn \c_chemmacros_version_subrelease_tl {}
\tl_const:Nx \c_chemmacros_version_number_tl
{
\c_chemmacros_version_major_number_tl .
@@ -52,7 +51,7 @@
{chemmacros}
{\c_chemmacros_date_tl}
{\c_chemmacros_version_tl}
- {\c_chemmacros_info_tl \c_space_tl (CN)}
+ {\c_chemmacros_info_tl \c_space_tl (CN~ &~ SK)}
% --------------------------------------------------------------------------
% variants of kernel functions:
@@ -69,7 +68,7 @@
\cs_generate_variant:Nn \int_to_arabic:n {V}
-\cs_generate_variant:Nn \msg_error:nnnnn {nnnx}
+\cs_generate_variant:Nn \msg_error:nnnnn {nnnx,nnnxx}
\cs_generate_variant:Nn \msg_error:nnnn {nnnx}
\cs_generate_variant:Nn \msg_error:nnn {nnV}
\cs_generate_variant:Nn \msg_warning:nnn {nnV}
@@ -122,29 +121,36 @@
\clist_new:N \l_chemmacros_modules_clist
\clist_set:Nn \l_chemmacros_modules_clist
{
- base, errorcheck, lang, greek, chemformula, charges, acid-base, symbols,
+ base, errorcheck, lang, greek, formula, charges, acid-base, symbols,
particles, phases, nomenclature, tikz, xfrac, translations
}
\clist_const:Nn \c_chemmacros_all_modules_clist
{
- base, errorcheck, lang, greek, chemformula, charges, acid-base, symbols,
+ base, errorcheck, lang, greek, formula, charges, acid-base, symbols,
particles, phases, nomenclature, tikz, isotopes, mechanisms, newman,
orbital, polymers, reactions, redox, xfrac, scheme, spectroscopy,
thermodynamics, units, reactants, translations
}
-\keys_define:nn {chemmacros/package-options}
+\tl_new:N \g__chemmacros_module_stop_tl
+
+\cs_new_protected:Npn \chemmacros_stop_module:n #1
+ { \tl_gput_right:Nn \g__chemmacros_module_stop_tl {{#1}} }
+
+\keys_define:nn {chemmacros/load-time}
{
minimal .bool_set:N = \l__chemmacros_minimal_bool ,
minimal .initial:n = false ,
modules .code:n =
\clist_if_in:NnF \l_chemmacros_modules_clist {#1}
{ \clist_put_right:Nn \l_chemmacros_modules_clist {#1} } ,
+ stop .code:n =
+ \clist_map_inline:nn {#1} { \chemmacros_stop_module:n {##1} } ,
unknown .code:n = \__chemmacros_loadtime_warning:n {unknown-option}
}
-\ProcessKeysPackageOptions {chemmacros/package-options}
+\ProcessKeysPackageOptions {chemmacros/load-time}
\keys_define:nn {chemmacros}
{
@@ -152,8 +158,8 @@
modules .code:n =
\msg_warning:nn {chemmacros} {module-mechanism}
\__chemmacros_loadtime_warning:n {load-time-option} ,
- package-options / minimal .meta:nn = {chemmacros} {minimal} ,
- package-options / modules .meta:nn = {chemmacros} {modules}
+ load-time / minimal .meta:nn = {chemmacros} {minimal} ,
+ load-time / modules .meta:nn = {chemmacros} {modules}
}
\NewDocumentCommand \usechemmodule {m}
@@ -219,8 +225,14 @@
\msg_new:nnn {chemmacros} {forbidden-module}
{
You've~ requested~ the~ chemmacros~ module~ `modules'~ \msg_line_context: .~
- This~ module~ is~ a~ pseudo~ module~ which~ may~ not~ be~ loaded~ through~
- the~ module~ loading~ mechansim.
+ This~ module~ is~ a~ pseudo~ module~ which~ may~ not~ be~ loaded~ through~
+ the~ module~ loading~ mechansim.
+ }
+
+\msg_new:nnn {chemmacros} {before-module}
+ {
+ The~ module~ `#1'~ has~ already~ been~ loaded.~ The~ code~ cannot~ be~
+ inserted~ before~ it~ \msg_line_context:
}
% ----------------------------------------------------------------------------
@@ -232,9 +244,87 @@
}
% ----------------------------------------------------------------------------
+% deprecation & removal
+\msg_new:nnn {chemmacros} {deprecated}
+ {
+ On~ line~ \msg_line_number: : \\
+ The~ #1~ `#2'~ is~ deprecated.~ Use~ #1~ `#3'~ instead .
+ }
+
+\msg_new:nnn {chemmacros} {deprecated-function}
+ { The~ command~ #1~ is~ deprecated.~ Use~ #2 instead . }
+
+\msg_new:nnn {chemmacros} {removed-function}
+ { The~ command~ #1~ has~ been~ removed. }
+
+\msg_new:nnn {chemmacros} {removed}
+ {
+ On~ line~ \msg_line_number: : \\
+ The~ #1~ `#2'~ has~ been~ removed~ from~ chemmacros. \\
+ If~ you~ need~ it~ back~ please~ open~ an~ issue~ on~ \\
+ https://github.com/cgnieder/chemmacros/issues
+ \tl_if_blank:nF {#3} { \\ #3 }
+ }
+
+% #1: type
+% #2: old
+% #3: new
+\cs_new_protected:Npn \__chemmacros_deprecation_warning:nnn #1#2#3
+ { \msg_warning:nnnnn {chemmacros} {deprecated} {#1} {#2} {#3} }
+\cs_generate_variant:Nn \__chemmacros_deprecation_warning:nnn {nne,nV}
+
+% #1: type
+% #2: old
+% #3: additional text
+\cs_new_protected:Npn \chemmacros_removal_warning:nnn #1#2#3
+ { \msg_warning:nnnnn {chemmacros} {removed} {#1} {#2} {#3} }
+\cs_generate_variant:Nn \chemmacros_removal_warning:nnn {nV}
+
+% #1: type
+% #2: old
+\cs_new_protected:Npn \chemmacros_removal_warning:nn #1#2
+ { \msg_warning:nnnn {chemmacros} {removed} {#1} {#2} }
+\cs_generate_variant:Nn \chemmacros_removal_warning:nn {nV}
+
+% #1: new
+\cs_new_protected:Npn \chemmacros_deprecate_option:n #1
+ { \__chemmacros_deprecation_warning:nVn {option} \l_keys_key_str {#1} }
+
+\cs_new_protected:Npn \chemmacros_deprecate_option:
+ { \__chemmacros_deprecation_warning:nV {option} \l_keys_key_str }
+
+% #1: additional text
+\cs_new_protected:Npn \chemmacros_remove_option:n #1
+ { \chemmacros_removal_warning:nVn {option} \l_keys_key_str {#1} }
+
+\cs_new_protected:Npn \chemmacros_remove_option:
+ { \chemmacros_removal_warning:nV {option} \l_keys_key_str }
+
+% #1: old
+% #2: new
+\cs_new_protected:Npn \chemmacros_deprecate_function:NN #1#2
+ {
+ \cs_set_protected:Npn #1
+ {
+ \msg_error:nnnn {chemmacros} {deprecated-function} {#1} {#2}
+ #2
+ }
+ }
+
+% #1: old
+\cs_new_protected:Npn \chemmacros_remove_function:N #1
+ {
+ \cs_set_protected:Npn #1
+ { \msg_error:nnn {chemmacros} {removed-function} {#1} }
+ }
+
+\NewDocumentCommand \DeclareChemDeprecated {mm}
+ { \chemmacros_deprecate_function:NN #1 #2 }
+
+% ----------------------------------------------------------------------------
% this is for external file modules called "styles":
\tl_const:Nn \c__chemmacros_module_extension_tl {code.tex}
-\tl_const:Nn \c__chemmacros_module_prefix_tl {chemmacros}
+\tl_const:Nn \c__chemmacros_module_prefix_tl {chemmacros.style}
\tl_new:N \g__chemmacros_modules_loaded_tl
@@ -256,7 +346,8 @@
\chemmacros_module_if_exist:nTF {#1}
{
\__chemmacros_module_hook_use:nn {#1} {before}
- \msg_info:nnn {chemmacros} {loading-module} {#1}
+ \msg_log:nnn {chemmacros} {loading-module} {#1}
+ \msg_term:nnn {chemmacros} {loading-module} {#1}
\@onefilewithoptions
{\c__chemmacros_module_prefix_tl.#1}[][]
\c__chemmacros_module_extension_tl
@@ -297,8 +388,8 @@
% #2: code
\cs_new_protected:Npn \chemmacros_module_before:nn #1#2
{
- % TODO: error in T case?
- \chemmacros_module_if_loaded:nF {#1}
+ \chemmacros_module_if_loaded:nTF {#1}
+ { \msg_error:nnn {chemmacros} {before-module} {#1} }
{ \__chemmacros_add_to_module_hook:nnn {#1} {before} {#2} }
}
@@ -328,14 +419,9 @@
\cs_generate_variant:Nn \__chemmacros_module_hook_use:nn {V}
% --------------------------------------------------------------------------
-\tl_new:N \l__chemmacros_module_date_tl
-\tl_new:N \l__chemmacros_module_version_tl
-
-\tl_set_eq:NN \l__chemmacros_module_date_tl \c_chemmacros_date_tl
-\tl_set_eq:NN \l__chemmacros_module_version_tl \c_chemmacros_version_tl
-
\cs_new_protected:Npn \__chemmacros_module:nn #1#2
{
+ \str_if_in:NnT \g__chemmacros_module_stop_tl {{#1}} { \file_input_stop: }
\tl_gput_right:Nn \g__chemmacros_modules_loaded_tl {{#1}}
\str_if_eq:xxF
{\c__chemmacros_module_prefix_tl.#1.\c__chemmacros_module_extension_tl}
@@ -345,24 +431,38 @@
{#1}
{\@currname.\@currext}
}
- \ProvidesFile
- {\c__chemmacros_module_prefix_tl.#1.\c__chemmacros_module_extension_tl}
- [
- \l__chemmacros_module_date_tl
- \c_space_tl
- v \l__chemmacros_module_version_tl
- \c_space_tl
- chemmacros~ style~ file~ `#1'~ (#2)
- ]
+ \tl_if_blank:nTF {#2}
+ {
+ \ProvidesFile
+ {\c__chemmacros_module_prefix_tl.#1.\c__chemmacros_module_extension_tl}
+ }
+ {
+ \ProvidesFile
+ {\c__chemmacros_module_prefix_tl.#1.\c__chemmacros_module_extension_tl}
+ [#2]
+ }
}
+% define a chemmacros style:
+% standard modules are written in the expl3 programming environment, the
+% starred version only uses a 2e programming environment, i.e., with @ as a
+% letter
+% #1: name
+% #2: description
+\NewDocumentCommand \ChemStyle {smo}
+ {
+ \IfNoValueTF {#3}
+ { \__chemmacros_module:nn {#2} {#3} }
+ { \__chemmacros_module:nn {#2} {} }
+ \bool_if:nF {#1} { \ExplSyntaxOn }
+ }
+
+% command for loading styles:
+\NewDocumentCommand \usechemstyle {m} { \chemmacros_modules_load:n {#1} }
+
% --------------------------------------------------------------------------
% define internal chemmacros modules:
\tl_new:N \g_chemmacros_module_tl
-\tl_new:N \g__chemmacros_module_stop_tl
-
-\cs_new_protected:Npn \chemmacros_stop_module:n #1
- { \tl_gput_right:Nn \g__chemmacros_module_stop_tl {{#1}} }
% #1: name
% #2: description
@@ -370,8 +470,8 @@
{
\str_if_in:NnT \g__chemmacros_module_stop_tl {{#1}}
{ \__chemmacros_gobble_module:w }
- \msg_log:nnnn {chemmacros} {loading-module} {#1} {#2}
- \msg_term:nnnn {chemmacros} {loading-module} {#1} {#2}
+ \msg_log:nnn {chemmacros} {loading-module} {#1}
+ \msg_term:nnn {chemmacros} {loading-module} {#1}
\tl_gput_right:Nn \g__chemmacros_modules_loaded_tl {{#1}}
\tl_gset:Nn \g_chemmacros_module_tl {#1}
\__chemmacros_module_hook_use:nn {#1} {before}
@@ -392,22 +492,12 @@
\ChemModule{base}{2022/01/10 basic chemmacros module}
% --------------------------------------------------------------------------
-\msg_new:nnn {chemmacros} {command-deprecated}
- {
- The~ command~ \token_to_str:N #1 \c_space_tl is~ deprecated.~ Use~
- \token_to_str:N #2 \c_space_tl instead.
- }
-
-% define a deprecated command with hints to the corresponding new one:
-\cs_new_protected:Npn \chemmacros_define_deprecated:NN #1#2
+\msg_new:nnn {chemmacros} {patch-failed}
{
- \cs_set_protected:Npn #1
- { \msg_warning:nnnn {chemmacros} {command-deprecated} {#1} {#2} #2 }
+ I~ failed~ to~ patch~ \token_to_str:N #1 .~ Please~ contact~ the~ package~
+ author.
}
-\NewDocumentCommand \DeclareChemDeprecated {mm}
- { \chemmacros_define_deprecated:NN #1 #2 }
-
% --------------------------------------------------------------------------
% define a macro set:
% \NewChem... \RenewChem... \DeclareChem... \ProvideChem...
@@ -519,7 +609,7 @@
\cs_new_protected:Npn \chemmacros_set_keys:nn #1#2
{ \keys_set:nn {chemmacros/#1} {#2} }
-\cs_generate_variant:Nn \chemmacros_set_keys:nn {x,nx}
+\cs_generate_variant:Nn \chemmacros_set_keys:nn {e,ne}
\cs_new_protected:Npn \chemmacros_set_keys_groups:nnn #1#2#3
{ \keys_set_groups:nnn {chemmacros/#1} {#2} {#3} }
@@ -595,6 +685,8 @@
{ \prg_return_true: }
{ \prg_return_false: }
}
+
+% --------------------------------------------------------------------------
\cs_new_protected:Npn \chemmacros_cs_if_free_new:Npn #1
{
\cs_if_exist:NF #1
@@ -609,6 +701,15 @@
}
\cs_generate_variant:Nn \chemmacros_cs_if_free_new_protected:Npn {c}
+% --------------------------------------------------------------------------
+\cs_new_protected:Npn \chemmacros_patch_cmd:Nnn #1#2#3
+ {
+ \patchcmd #1 {#2} {#3}
+ {}
+ { \msg_warning:nnn {chemmacros} {patch-failed} {#1} }
+ }
+
+% --------------------------------------------------------------------------
% #1: counter
% #2: singular
% #3: plural
@@ -729,7 +830,7 @@
\seq_new:N \l__chemmacros_if_bf_seq
-\seq_set_split:Nnn \l__chemmacros_if_bf_seq { , }
+\seq_set_split:Nnn \l__chemmacros_if_bf_seq {,}
{
b , bc , bm , bx , bux ,
eb , ebc , ebx , mb ,
@@ -748,9 +849,6 @@
{#1}
}
-\cs_new_protected:Npn \chemmacros_detect_bold:n
- { \error \chemmacros_bold:n }
-
% --------------------------------------------------------------------------
\RequirePackage{amstext}
@@ -808,7 +906,7 @@
}
\ChemModuleEnd
-\ChemModule{errorcheck}{2022/01/16 error checking for unloaded modules}
+\ChemModule{errorcheck}{2022/01/23 error checking for unloaded modules}
\msg_new:nnn {chemmacros} {undefined}
{
@@ -881,6 +979,24 @@
\chemmacros_command_requires_module:Nn \listofreactions {reactions}
\chemmacros_command_requires_module:Nn \AddRxnDesc {reactions}
+% reactants module
+\chemmacros_command_requires_module:Nn \DeclareChemReactant {reactants}
+\chemmacros_command_requires_module:Nn \reactant {reactants}
+\chemmacros_command_requires_module:Nn \reactants {reactants}
+\chemmacros_command_requires_module:Nn \reactantl {reactants}
+\chemmacros_command_requires_module:Nn \Reactant {reactants}
+\chemmacros_command_requires_module:Nn \solvent {reactants}
+\chemmacros_command_requires_module:Nn \solvents {reactants}
+\chemmacros_command_requires_module:Nn \solventl {reactants}
+\chemmacros_command_requires_module:Nn \Solvent {reactants}
+\chemmacros_command_requires_module:Nn \reactantplain {reactants}
+\chemmacros_command_requires_module:Nn \Reactantplain {reactants}
+\chemmacros_command_requires_module:Nn \submainreactantplain {reactants}
+\chemmacros_command_requires_module:Nn \Submainreactantplain {reactants}
+\chemmacros_command_requires_module:Nn \solventplain {reactants}
+\chemmacros_command_requires_module:Nn \Solventplain {reactants}
+\chemmacros_command_requires_module:Nn \printreactants {reactants}
+
% redox module
\chemmacros_command_requires_module:Nn \ox {redox}
\chemmacros_command_requires_module:Nn \OX {redox}
@@ -1092,7 +1208,7 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{chemformula}{2020/11/29 integration of chemical formulas}
+\ChemModule{formula}{2022/01/29 integration of chemical formulas}
\RequirePackage{amstext}
@@ -1108,10 +1224,14 @@
method~ `chemformula'.
}
+\msg_new:nnn {chemmacros} {formula-method}
+ { Using~ the~ formula~ method~ `#1'. }
+
\msg_new:nnn {chemmacros} {formula-conflict}
{
- You~ have~ loaded~ multiple~ formula~ method~ packages~ but~ haven't~
- chosen~ which~ method~ to~ use!~ I~ will~ use~ `chemformula'. \\
+ You~ have~ loaded~ both~ `chemformula'~ and~ `mhchem'~ as~ formula~
+ package~ but~ haven't~ chosen~ which~ formula~ method~ to~ use! \\
+ I~ will~ use~ `chemformula'. \\
You~ should~ decide~ for~ only~ one~ of~ the~ packages~ for~ having~ a~
consistent~ layout.
}
@@ -1120,10 +1240,12 @@
% generic functions for usage in other packages; those are to be set in each
% method setup:
\cs_new_protected:Npn \chemmacros_reaction:n #1 {#1}
-\cs_new_protected:Npn \chemmacros_chemformula:n #1 {#1}
-\cs_generate_variant:Nn \chemmacros_chemformula:n { x,V }
+\cs_new_protected:Npn \chemmacros_formula:n #1 {#1}
+\cs_generate_variant:Nn \chemmacros_formula:n { x,V,e }
+
+\chemmacros_deprecate_function:NN \chemmacros_chemformula:n \chemmacros_formula:n
-\cs_new_protected:Npn \chemmacros@formula #1 { \chemmacros_chemformula:n {#1} }
+\cs_new_protected:Npn \chemmacros@formula #1 { \chemmacros_formula:n {#1} }
\cs_new_protected:Npn \chemmacros@reaction #1 { \chemmacros_reaction:n {#1} }
% --------------------------------------------------------------------------
@@ -1133,22 +1255,22 @@
\tl_new:N \g_chemmacros_formula_method_tl
\tl_gset:Nn \g_chemmacros_formula_method_tl {chemformula}
-\prop_new:N \l__chemmacros_method_packages_prop
+\prop_new:N \l__chemmacros_formula_methods_prop
% #1: package/method name
% #2: preparations
-\cs_new_protected:Npn \chemmacros_add_method_package:nn #1#2
- { \prop_put:Nnn \l__chemmacros_method_packages_prop {#1} {#2} }
+\cs_new_protected:Npn \chemmacros_add_formula_method:nn #1#2
+ { \prop_put:Nnn \l__chemmacros_formula_methods_prop {#1} {#2} }
-\cs_new_protected:Npn \chemmacros_setup_method_package:n #1
+\cs_new_protected:Npn \chemmacros_setup_formula_method:n #1
{
- \prop_item:Nn \l__chemmacros_method_packages_prop {#1}
+ \prop_item:Nn \l__chemmacros_formula_methods_prop {#1}
\tl_gset:Nn \g_chemmacros_formula_method_tl {#1}
}
-\prg_new_conditional:Npnn \chemmacros_if_method_package:n #1 {p,T,F,TF}
+\prg_new_conditional:Npnn \chemmacros_if_formula_method:n #1 {p,T,F,TF}
{
- \prop_if_in:NnTF \l__chemmacros_method_packages_prop {#1}
+ \prop_if_in:NnTF \l__chemmacros_formula_methods_prop {#1}
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -1158,7 +1280,7 @@
\bool_if:NF \l__chemmacros_formula_method_set_bool
{
\bool_set_false:N \l__chemmacros_tmpa_bool
- \prop_map_inline:Nn \l__chemmacros_method_packages_prop
+ \clist_map_inline:nn {chemformula,mhchem}
{
\chemmacros_if_package_loaded:nT {##1}
{
@@ -1181,11 +1303,11 @@
\cs_new_protected:Npn \chemmacros_set_formula_method:n #1
{
- \chemmacros_if_method_package:nTF {#1}
- { \chemmacros_setup_method_package:n {#1} }
+ \chemmacros_if_formula_method:nTF {#1}
+ { \chemmacros_setup_formula_method:n {#1} }
{
\msg_warning:nnn {chemmacros} {unknown-formula-method} {#1}
- \chemmacros_setup_method_package:n {chemformula}
+ \chemmacros_setup_formula_method:n {chemformula}
}
\bool_set_true:N \l__chemmacros_formula_method_set_bool
}
@@ -1193,19 +1315,19 @@
% --------------------------------------------------------------------------
% add formula methods:
-\chemmacros_add_method_package:nn {chemformula}
+\chemmacros_add_formula_method:nn {chemformula}
{
- \chemmacros_integrate_package:nnn {} {chemformula} {2015/09/08}
- \cs_set_protected:Npn \chemmacros_chemformula:n #1
+ \chemmacros_integrate_package:nnn {} {chemformula} {2022/01/23}
+ \cs_set_protected:Npn \chemmacros_formula:n #1
{ \chemformula_chcpd:nn {} {#1} }
\cs_set_protected:Npn \chemmacros_reaction:n #1
{ \chemformula_ch:nn {} {#1} }
}
-\chemmacros_add_method_package:nn {mhchem}
+\chemmacros_add_formula_method:nn {mhchem}
{
\chemmacros_integrate_package:nnn {version=4} {mhchem} {}
- \cs_set_protected:Npn \chemmacros_chemformula:n #1 { \ce {#1} }
+ \cs_set_protected:Npn \chemmacros_formula:n #1 { \ce {#1} }
\cs_set_protected:Npn \chemmacros_reaction:n #1 { \ce {#1} }
\chemmacros_module_after:nn {charges}
{
@@ -1219,10 +1341,10 @@
}
}
-\chemmacros_add_method_package:nn {chemist}
+\chemmacros_add_formula_method:nn {chemist}
{
\RequirePackage {chemist}
- \cs_set_protected:Npn \chemmacros_chemformula:n #1
+ \cs_set_protected:Npn \chemmacros_formula:n #1
{ \chemmacros_text:n { \ChemForm {#1} } }
\cs_set_protected:Npn \chemmacros_reaction:n #1
{ \chemmacros_text:n { \ChemForm {#1} } }
@@ -1239,17 +1361,16 @@
}
}
-\chemmacros_add_method_package:nn {chemfig}
+\chemmacros_add_formula_method:nn {chemfig}
{
\RequirePackage {chemfig}
- \cs_set_protected:Npn \chemmacros_chemformula:n #1
- { \printatom {#1} }
+ \cs_set_protected:Npn \chemmacros_formula:n #1 { \printatom {#1} }
\cs_set_protected:Npn \chemmacros_reaction:n #1
- { \printatom {#1} }
+ { \schemestart #1 \schemestop }
\chemmacros_module_after:nn {charges}
{
\cs_set_protected:Npn \chemmacros_elpair:n #1
- { \Lewis { 0: , \printatom {#1} } }
+ { \Charge { 0=\: } {#1} }
\cs_set_protected:Npn \chemmacros_plus: { + }
\cs_set_protected:Npn \chemmacros_minus: { - }
\cs_set_protected:Npn \chemmacros_formal_plus: { \ensuremath{\oplus} }
@@ -1264,17 +1385,11 @@
{ formula .code:n = \chemmacros_set_formula_method:n {#1} }
\hook_gput_code:nnn {begindocument/before} {chemmacros}
- {
- \bool_if:NF \l__chemmacros_formula_method_set_bool
- {
- \msg_info:nn {chemmacros} {default-formula-method}
- \chemmacros_set_formula_method:n {chemformula}
- }
- }
+ { \chemmacros_check_formula_method: }
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{charges}{2020/11/29 charges}
+\ChemModule{charges}{2022/01/29 charges}
% --------------------------------------------------------------------------
% circled charge signs: they are defined in the `chemformula' package:
@@ -1339,7 +1454,7 @@
\cs_new_protected:Npn \chemmacros_formal_minus: { \chemformula_formal_minus: }
\cs_new_protected:Npn \chemmacros_charge:n #1
- { \chemmacros_chemformula:n { {}^{#1} } }
+ { \chemmacros_formula:n { {}^{#1} } }
\cs_new_protected:Npn \chemmacros_new_charge_command:Nn #1#2
{
@@ -1403,7 +1518,7 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{acid-base}{2022/01/13 acid/base}
+\ChemModule{acid-base}{2022/01/29 acid/base}
% --------------------------------------------------------------------------
% equilibrium constants:
@@ -1487,8 +1602,8 @@
}
\NewDocumentCommand \p {m} { \chemmacros_p:n {#1} }
-\NewDocumentCommand \pH {} { \chemmacros_p:n { \chemmacros_chemformula:n {H} } }
-\NewDocumentCommand \pOH {} { \chemmacros_p:n { \chemmacros_chemformula:n {OH} } }
+\NewDocumentCommand \pH {} { \chemmacros_p:n { \chemmacros_formula:n {H} } }
+\NewDocumentCommand \pOH {} { \chemmacros_p:n { \chemmacros_formula:n {OH} } }
\NewDocumentCommand \pKa {o}
{
@@ -1573,7 +1688,7 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{particles}{2020/11/29 particles}
+\ChemModule{particles}{2022/01/29 particles}
% --------------------------------------------------------------------------
% particles
@@ -1583,7 +1698,7 @@
\use:x
{
\cs_set_protected:Npn \exp_not:N #1
- { \chemmacros_chemformula:n { \exp_not:V \l__chemmacros_tmpa_tl } }
+ { \chemmacros_formula:n { \exp_not:V \l__chemmacros_tmpa_tl } }
}
}
@@ -1634,9 +1749,9 @@
{
\chemmacros_elpair:n { #2 }
\skip_horizontal:N \l__chemmacros_nucleophile_dim
- \chemmacros_chemformula:n { {}^{-} }
+ \chemmacros_formula:n { {}^{-} }
}
- { \chemmacros_chemformula:n { #2^{-} } }
+ { \chemmacros_formula:n { #2^{-} } }
}
\DeclareDocumentCommand #1 {o}
{
@@ -1713,7 +1828,7 @@
{
\mode_leave_vertical:
\bool_if:NTF \l__chemmacros_phases_sub_bool
- { \chemformula_subscript:n { (#1) } }
+ { \chemmacros_formula:n { {}_{(#1)} } }
{
\skip_horizontal:N \l__chemmacros_phases_space_dim
\chemmacros_text:n { (#1) }
@@ -1730,7 +1845,7 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{nomenclature}{2022/01/10 chemical names}
+\ChemModule{nomenclature}{2022/01/29 chemical names}
\bool_new:N \l__chemmacros_iupac_restricted_bool
\bool_new:N \l__chemmacros_iupac_strict_bool
@@ -1900,43 +2015,14 @@
{ \chemmacros_let_iupac:NN #1 #2 }
% --------------------------------------------------------------------------
-\chemmacros_define_keys:nn {nomenclature}
- {
- iupac .choice: ,
- iupac / restricted .code:n =
- \bool_set_true:N \l__chemmacros_iupac_restricted_bool
- \bool_set_false:N \l__chemmacros_iupac_strict_bool ,
- iupac / auto .code:n =
- \bool_set_false:N \l__chemmacros_iupac_restricted_bool
- \bool_set_false:N \l__chemmacros_iupac_strict_bool ,
- iupac / strict .code:n =
- \bool_set_false:N \l__chemmacros_iupac_restricted_bool
- \bool_set_true:N \l__chemmacros_iupac_strict_bool ,
- iupac .initial:n = auto
- }
-
-% --------------------------------------------------------------------------
% stereo descriptors and other nomenclature commands
% Cahn-Ingold-Prelog
\dim_new:N \l__chemmacros_cip_kern_dim
\dim_set:Nn \l__chemmacros_cip_kern_dim {.075em}
-\chemmacros_define_keys:nn {nomenclature}
- { cip-kern .dim_set:N = \l__chemmacros_cip_kern_dim }
-
\tl_new:N \l__chemmacros_cip_inner_tl
\tl_new:N \l__chemmacros_cip_outer_tl
\tl_new:N \l__chemmacros_cip_number_tl
-
-\chemmacros_define_keys:nn {nomenclature}
- {
- cip-inner-format .tl_set:N = \l__chemmacros_cip_inner_tl ,
- cip-inner-format .initial:n = \itshape ,
- cip-outer-format .tl_set:N = \l__chemmacros_cip_outer_tl ,
- cip-outer-format .initial:n = \upshape ,
- cip-number-format .tl_set:N = \l__chemmacros_cip_number_tl ,
- cip-number-format .initial:n = \upshape
- }
\cs_new_protected:Npn \__chemmacros_cip:n #1
{
@@ -2005,29 +2091,18 @@
% coordination chemistry
\bool_new:N \l__chemmacros_bridge_super_bool
-\chemmacros_define_keys:nn {nomenclature}
- {
- bridge-number .choice: ,
- bridge-number / sub .code:n =
- \bool_set_false:N \l__chemmacros_bridge_super_bool ,
- bridge-number / super .code:n =
- \bool_set_true:N \l__chemmacros_bridge_super_bool ,
- coord-use-hyphen .bool_set:N = \l__chemmacros_coord_use_hyphen_bool ,
- coord-use-hyphen .initial:n = true
- }
-
% #1: boolean - if true hyphen is turned on
% #2: boolean - if true superscript will be used
% #3: symbol
% #4: sub-/superscript
\cs_new_protected:Npn \chemmacros_coordination_symbol:nnnn #1#2#3#4
{
- \chemmacros_chemformula:n {#3}
+ \chemmacros_formula:n {#3}
\tl_if_blank:nF {#4}
{
\bool_if:nTF {#2}
- { \chemmacros_chemformula:n { {}^{#4} } }
- { \chemmacros_chemformula:n { {}_{#4} } }
+ { \chemmacros_formula:n { {}^{#4} } }
+ { \chemmacros_formula:n { {}_{#4} } }
}
\bool_if:nT
{#1}
@@ -2127,13 +2202,6 @@
\skip_new:N \l__chemmacros_iupac_break_skip
\skip_set:Nn \l__chemmacros_iupac_break_skip { .03em plus .07em }
-\chemmacros_define_keys:nn {nomenclature}
- {
- hyphen-pre-space .dim_set:N = \l__chemmacros_iupac_hyphen_pre_dim ,
- hyphen-post-space .dim_set:N = \l__chemmacros_iupac_hyphen_post_dim ,
- break-space .skip_set:N = \l__chemmacros_iupac_break_skip
- }
-
\cs_new_protected:Npn \chemmacros_break_point_hyphen:
{
\__chemmacros_break_point_insert:nnn
@@ -2255,17 +2323,8 @@
\NewDocumentCommand \RemoveChemIUPACShorthand {m}
{ \chemmacros_remove_shorthand:N #1 }
-\NewChemIUPACShorthand ^ \chemmacros_superscript:n
-\NewChemIUPACShorthand | \chemmacros_break_point:
-\NewChemIUPACShorthand - \chemmacros_break_point_hyphen:
-\NewChemIUPACShorthand ( \chemmacros_break_point_opening_paren:
-\NewChemIUPACShorthand ) \chemmacros_break_point_closing_paren:
-\NewChemIUPACShorthand [ \chemmacros_break_point_opening_bracket:
-\NewChemIUPACShorthand ] \chemmacros_break_point_closing_bracket:
-\NewChemIUPAC \chemprime { \ensuremath {{}^{\prime}} }
-\NewChemIUPACShorthand ' \chemprime
-\NewChemIUPAC \nonbreakinghyphen { \mbox{-} \nobreak \hspace{0pt} }
-\NewChemIUPACShorthand = \nonbreakinghyphen
+% --------------------------------------------------------------------------
+\tl_new:N \l__chemmacros_iupac_format_tl
\cs_new_protected:Npn \chemmacros_iupac:nn #1#2
{
@@ -2278,7 +2337,7 @@
\tl_set_rescan:Nnn \l__chemmacros_tmpa_tl
{ \chemmacros_activate_all_iupac_shorthands: }
{#2}
- \l__chemmacros_tmpa_tl
+ \l__chemmacros_iupac_format_tl { \l__chemmacros_tmpa_tl }
\group_end:
}
@@ -2288,6 +2347,18 @@
\NewDocumentCommand \iupac {O{}m} { \chemmacros_iupac:nn {#1} {#2} }
% --------------------------------------------------------------------------
+\NewChemIUPACShorthand ^ \chemmacros_superscript:n
+\NewChemIUPACShorthand | \chemmacros_break_point:
+\NewChemIUPACShorthand - \chemmacros_break_point_hyphen:
+\NewChemIUPACShorthand ( \chemmacros_break_point_opening_paren:
+\NewChemIUPACShorthand ) \chemmacros_break_point_closing_paren:
+\NewChemIUPACShorthand [ \chemmacros_break_point_opening_bracket:
+\NewChemIUPACShorthand ] \chemmacros_break_point_closing_bracket:
+\NewChemIUPAC \chemprime { \ensuremath {{}^{\prime}} }
+\NewChemIUPACShorthand ' \chemprime
+\NewChemIUPAC \nonbreakinghyphen { \mbox{-} \nobreak \hspace{0pt} }
+\NewChemIUPACShorthand = \nonbreakinghyphen
+
% R(ectus)/S(inister):
\NewChemIUPAC \rectus { \cip {R} }
\NewChemIUPAC \sinister { \cip {S} }
@@ -2371,12 +2442,6 @@
\NewChemMacroset {Latin} {mm}
{ \chemmacros_define_latin:Nn #1 {#2} }
-
-\chemmacros_define_keys:nn {nomenclature}
- {
- format .tl_set:N = \l__chemmacros_latin_format_tl ,
- format .initial:n = \emph ,
- }
\cs_new_protected:Npn \chemmacros_write_latin:n #1
{
@@ -2405,6 +2470,43 @@
\NewChemLatin \insitu {in~situ}
% --------------------------------------------------------------------------
+\chemmacros_define_keys:nn {nomenclature}
+ {
+ iupac .choice: ,
+ iupac / restricted .code:n =
+ \bool_set_true:N \l__chemmacros_iupac_restricted_bool
+ \bool_set_false:N \l__chemmacros_iupac_strict_bool ,
+ iupac / auto .code:n =
+ \bool_set_false:N \l__chemmacros_iupac_restricted_bool
+ \bool_set_false:N \l__chemmacros_iupac_strict_bool ,
+ iupac / strict .code:n =
+ \bool_set_false:N \l__chemmacros_iupac_restricted_bool
+ \bool_set_true:N \l__chemmacros_iupac_strict_bool ,
+ iupac .initial:n = auto ,
+ iupac-format .tl_set:N = \l__chemmacros_iupac_format_tl ,
+ cip-kern .dim_set:N = \l__chemmacros_cip_kern_dim ,
+ cip-inner-format .tl_set:N = \l__chemmacros_cip_inner_tl ,
+ cip-inner-format .initial:n = \itshape ,
+ cip-outer-format .tl_set:N = \l__chemmacros_cip_outer_tl ,
+ cip-outer-format .initial:n = \upshape ,
+ cip-number-format .tl_set:N = \l__chemmacros_cip_number_tl ,
+ cip-number-format .initial:n = \upshape ,
+ bridge-number .choice: ,
+ bridge-number / sub .code:n =
+ \bool_set_false:N \l__chemmacros_bridge_super_bool ,
+ bridge-number / super .code:n =
+ \bool_set_true:N \l__chemmacros_bridge_super_bool ,
+ coord-use-hyphen .bool_set:N = \l__chemmacros_coord_use_hyphen_bool ,
+ coord-use-hyphen .initial:n = true ,
+ hyphen-pre-space .dim_set:N = \l__chemmacros_iupac_hyphen_pre_dim ,
+ hyphen-post-space .dim_set:N = \l__chemmacros_iupac_hyphen_post_dim ,
+ break-space .skip_set:N = \l__chemmacros_iupac_break_skip ,
+ latin-format .tl_set:N = \l__chemmacros_latin_format_tl ,
+ latin-format .initial:n = \emph ,
+ format .code:n = \chemmacros_deprecate_option:n {latin-format}
+ }
+
+% --------------------------------------------------------------------------
% hyperref support
% ?? unsure about adding IUPAC commands
\hook_gput_code:nnn {package/hyperref/after} {chemmacros}
@@ -2453,7 +2555,7 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{tikz}{2020/11/29 upright greek symbols}
+\ChemModule{tikz}{2020/11/29 ease usage of TikZ in chemmacros}
\ExplSyntaxOff
\RequirePackage{tikz}
@@ -2485,7 +2587,7 @@
\dim_new:N \l__chemmacros_el_length_dim
% full tip for pairs
-\pgfarrowsdeclare { el } { el }
+\pgfarrowsdeclare {el} {el}
{
\dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
@@ -2495,10 +2597,10 @@
{
\dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
- \pgfsetdash {} { 0pt }
+ \pgfsetdash {} {0pt}
\pgfsetroundjoin
\pgfsetroundcap
- \pgfpathmoveto { \pgfpoint { 0pt } { 0pt } }
+ \pgfpathmoveto { \pgfpoint {0pt} {0pt} }
\pgfpathlineto
{
\pgfpoint
@@ -2506,19 +2608,19 @@
{ .3\l__chemmacros_el_length_dim }
}
\pgfpathlineto
- { \pgfpoint { -.5\l__chemmacros_el_length_dim } { 0pt } }
+ { \pgfpoint { -.5\l__chemmacros_el_length_dim } {0pt} }
\pgfpathlineto
{
\pgfpoint
{ -\l__chemmacros_el_length_dim }
{ -.3\l__chemmacros_el_length_dim }
}
- \pgfpathlineto { \pgfpoint { 0pt } { 0pt } }
+ \pgfpathlineto { \pgfpoint {0pt} {0pt} }
\pgfusepathqfillstroke
}
% half tip on the left
-\pgfarrowsdeclare { left~el } { left~el }
+\pgfarrowsdeclare {left~ el} {left~ el}
{
\dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
@@ -2528,23 +2630,23 @@
{
\dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
- \pgfsetdash {} { 0pt }
+ \pgfsetdash {} {0pt}
\pgfsetroundjoin
\pgfsetroundcap
- \pgfpathmoveto { \pgfpoint { 0pt } { 0pt } }
+ \pgfpathmoveto { \pgfpoint {0pt} {0pt} }
\pgfpathlineto
{
\pgfpoint
{ -\l__chemmacros_el_length_dim }
{ .3\l__chemmacros_el_length_dim }
}
- \pgfpathlineto { \pgfpoint { -.5\l__chemmacros_el_length_dim } { 0pt } }
- \pgfpathlineto { \pgfpoint { 0pt } { 0pt } }
+ \pgfpathlineto { \pgfpoint { -.5\l__chemmacros_el_length_dim } {0pt} }
+ \pgfpathlineto { \pgfpoint {0pt} {0pt} }
\pgfusepathqfillstroke
}
% half tip in the right
-\pgfarrowsdeclare { right~el } { right~el }
+\pgfarrowsdeclare {right~ el} {right~ el}
{
\dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
@@ -2554,18 +2656,18 @@
{
\dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
- \pgfsetdash {} { 0pt }
+ \pgfsetdash {} {0pt}
\pgfsetroundjoin
\pgfsetroundcap
- \pgfpathmoveto { \pgfpoint { 0pt } { 0pt } }
+ \pgfpathmoveto { \pgfpoint {0pt} {0pt} }
\pgfpathlineto
{
\pgfpoint
{ -\l__chemmacros_el_length_dim }
{ -.3\l__chemmacros_el_length_dim }
}
- \pgfpathlineto { \pgfpoint { -.5\l__chemmacros_el_length_dim } { 0pt } }
- \pgfpathlineto { \pgfpoint { 0pt } { 0pt } }
+ \pgfpathlineto { \pgfpoint { -.5\l__chemmacros_el_length_dim } {0pt} }
+ \pgfpathlineto { \pgfpoint {0pt} {0pt} }
\pgfusepathqfillstroke
}
% --------------------------------------------------------------------------
@@ -2609,7 +2711,7 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{isotopes}{2020/11/29 a macro to easily print element isotopes}
+\ChemModule{isotopes}{2022/01/29 a macro to easily print element isotopes}
\RequirePackage{elements}
@@ -2802,9 +2904,9 @@
\cs_new_protected:Npn \chemmacros_isotope_write:nnn #1#2#3
{
\bool_if:NTF \l__chemmacros_isotope_super_bool
- { \chemmacros_chemformula:n { ^{#1}_{#2}#3 } }
+ { \chemmacros_formula:n { ^{#1}_{#2}#3 } }
{
- \chemmacros_chemformula:n {#3}
+ \chemmacros_formula:n {#3}
\tl_use:N \l__chemmacros_isotope_side_connect_tl
#1
}
@@ -3818,11 +3920,38 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{reactions}{2022/01/13 reaction environments}
+\ChemModule{reactions}{2022/02/05 reaction environments}
-\RequirePackage{mathtools}
+\newcounter {reaction}
+\hook_gput_code:nnn {package/hyperref/after} {chemmacros}
+ {
+ \cs_if_exist:NTF \chapter
+ { \cs_set:Npn \theHreaction { \theHchapter . \thereaction } }
+ { \cs_set:Npn \theHreaction { \theHsection . \thereaction } }
+ }
+
+\bool_new:N \l__chemmacros_reactions_counter_bool
+\bool_new:N \l__chemmacros_reactions_tocbasic_bool
+
+\cs_new_eq:NN \l@reaction \l@figure
+\cs_if_exist:NT \KOMAClassName
+ { \bool_set_true:N \l__chemmacros_reactions_tocbasic_bool }
+
+\tl_new:N \g__chemmacros_reaction_description_tl
+\tl_new:N \l__chemmacros_reactions_tag_open_tl
+\tl_new:N \l__chemmacros_reactions_tag_close_tl
+\tl_new:N \l__chemmacros_reactions_before_tag_tl
+\tl_new:N \l__chemmacros_reaction_lorname_tl
+\tl_new:N \reactionlistname
+\tl_new:N \reactionautorefname
+\tl_new:N \l__chemmacros_reactions_args_tl
% --------------------------------------------------------------------------
+\RequirePackage{mathtools}
+% redefine mathtools' command \MT_define_tagform:nwnn to ensure we add an
+% entry to the list of reactions even if the user redefines the reaction tag
+% this should probably be done via patching...
+
\cs_new_protected:Npn \__chemmacros_record_for_lor:nnnnn #1#2#3#4#5
{
\tl_if_eq:nnT {#1} {reaction}
@@ -3844,9 +3973,6 @@
}
}
-% redefine mathtools' command \MT_define_tagform:nwnn to ensure we add an
-% entry to the list of reactions even if the user redefines the reaction tag
-% this should probably be done via patching...
\hook_gput_code:nnn {package/mathtools/after} {chemmacros}
{
\cs_set_protected:Npn \MT_define_tagform:nwnn #1[#2]#3#4
@@ -3855,15 +3981,21 @@
{
% this is the original part:
\maketag@@@{#3\ignorespaces#2{##1}\unskip\@@italiccorr#4}
- % this is added => this disturbs hyperref:
+ % this is added (but disturbs hyperref):
\__chemmacros_record_for_lor:nnnnn
{#1} {#3} {#2} {##1} {#4}
}
}
}
-\tl_new:N \g__chemmacros_reaction_description_tl
+% --------------------------------------------------------------------------
+% create new tagform
+\newtagform {reaction}
+ [\l__chemmacros_reactions_before_tag_tl]
+ {\l__chemmacros_reactions_tag_open_tl}
+ {\l__chemmacros_reactions_tag_close_tl}
+% --------------------------------------------------------------------------
\cs_new_protected:Npn \chemmacros_add_reaction_description:n #1
{
\tl_if_blank:nF {#1}
@@ -3873,31 +4005,10 @@
\NewDocumentCommand \AddRxnDesc {m}
{ \chemmacros_add_reaction_description:n {#1} }
+% --------------------------------------------------------------------------
% define \listofreactions
-\tl_new:N \l__chemmacros_reaction_lorname_tl
-\tl_new:N \reactionlistname
-\tl_new:N \l__chemmacros_reaction_heading_tl
-
-\cs_new:Npn \__chemmacros_reaction_heading:n #1
- { \l__chemmacros_reaction_heading_tl {#1} }
-\cs_generate_variant:Nn \__chemmacros_reaction_heading:n { V }
-
-\tl_set:Nn \l__chemmacros_reaction_lorname_tl
- { \chemmacros_translate:n {Reaction} }
-
-\tl_set:Nn \reactionlistname { \chemmacros_translate:n {list-of-reactions} }
-
-\chemmacros_define_keys:nn {reactions}
- {
- list-name .tl_set:N = \reactionlistname ,
- list-entry .tl_set:N = \l__chemmacros_reaction_lorname_tl ,
- list-heading-cmd .code:n =
- \cs_set_protected:Npn \__chemmacros_reaction_heading:n ##1 {#1}
- }
-
-\cs_if_exist:NTF \chapter
- { \chemmacros_set_keys:nn {reactions} { list-heading-cmd = \chapter* {#1} } }
- { \chemmacros_set_keys:nn {reactions} { list-heading-cmd = \section* {#1} } }
+\cs_new_protected:Npn \__chemmacros_reaction_heading:n #1 {#1}
+\cs_generate_variant:Nn \__chemmacros_reaction_heading:n {V}
\cs_new_protected:Npn \listofreactions
{
@@ -3905,39 +4016,15 @@
\@starttoc {lor}
}
-\cs_new_eq:NN \l@reaction \l@figure
-
-\bool_new:N \l__chemmacros_reactions_tocbasic_bool
-\cs_if_exist:NT \KOMAClassName
- { \bool_set_true:N \l__chemmacros_reactions_tocbasic_bool }
-
-\tl_new:N \l__chemmacros_reactions_tag_open_tl
-\tl_new:N \l__chemmacros_reactions_tag_close_tl
-\tl_new:N \l__chemmacros_reactions_before_tag_tl
-
-\chemmacros_define_keys:nn {reactions}
- {
- tocbasic .bool_set:N = \l__chemmacros_reactions_tocbasic_bool ,
- tag-open .tl_set:N = \l__chemmacros_reactions_tag_open_tl ,
- tag-open .initial:n = \{ ,
- tag-close .tl_set:N = \l__chemmacros_reactions_tag_close_tl ,
- tag-close .initial:n = \} ,
- before-tag .tl_set:N = \l__chemmacros_reactions_before_tag_tl
- }
-
\hook_gput_code:nnn {package/tocbasic/after} {chemmacros}
{
- \bool_lazy_or:nnT
- { \chemmacros_if_package_loaded_p:n {tocbasic} }
- { \l__chemmacros_reactions_tocbasic_bool }
- {
- \RequirePackage {tocbasic}
- \addtotoclist [float] {lor}
- \cs_set_protected:Npn \listofreactions { \listoftoc {lor} }
- \cs_new:Npn \listoflorname { \reactionlistname }
- }
+ \addtotoclist [float] {lor}
+ \cs_set_protected:Npn \listofreactions { \listoftoc {lor} }
+ \cs_new:Npn \listoflorname { \reactionlistname }
}
+% --------------------------------------------------------------------------
+% cleveref:
\ChemCleverefSupport {reaction}
{ \chemmacros_translate:n {reaction} }
[ \chemmacros_translate:n {Reaction} ]
@@ -3948,84 +4035,106 @@
{
\creflabelformat {reaction}
{
- #2
\l__chemmacros_reactions_tag_open_tl
- #1
+ #2 #1 #3
\l__chemmacros_reactions_tag_close_tl
- #3
}
}
-\ChemFancyrefSupport {rct}
- { \chemmacros_translate:n {reaction} }
- [ \chemmacros_translate:n {Reaction} ]
-
-% create new tagform
-\newtagform {reaction}
- [\l__chemmacros_reactions_before_tag_tl]
- {\l__chemmacros_reactions_tag_open_tl}
- {\l__chemmacros_reactions_tag_close_tl}
-
-\newcounter {chemmacros_save_reaction}
-\newcounter {reaction}
-
-\cs_new_protected:Npn \__chemmacros_begin_reaction:
+% fancyref:
+\hook_gput_code:nnn {package/fancyref/after} {chemmacros}
{
- \patchcmd \thereaction {reaction} {equation} {} {}
- \cs_set_eq:NN \theequation \thereaction
- \cs_set_eq:NN \r@equation \r@reaction
- \cs_set_eq:NN \p@equation \p@reaction
- \cs_set:Npn \theHequation { R . \theHsection . \theequation }
- \setcounter {chemmacros_save_reaction} { \value {equation} }
- \setcounter {equation} { \value {reaction} }
- \chemmacros_if_package_loaded:nT {cleveref}
- { \crefalias {equation} {reaction} }
- \usetagform {reaction}
+ \cs_set:Npn \fancyrefrctlabelprefix {rct}
+ \cs_set:Npn \frefrctname { \chemmacros_translate:n {reaction} }
+ \cs_set:Npn \Frefrctname { \chemmacros_translate:n {Reaction} }
+ \frefformat {vario} { \fancyrefrctlabelprefix }
+ {
+ \frefrctname \fancyrefdefaultspacing
+ \textup {
+ \l__chemmacros_reactions_tag_open_tl
+ #1
+ \l__chemmacros_reactions_tag_close_tl
+ }
+ #3
+ }
+ \Frefformat {vario} { \fancyrefrctlabelprefix }
+ {
+ \Frefrctname \fancyrefdefaultspacing
+ \textup {
+ \l__chemmacros_reactions_tag_open_tl
+ #1
+ \l__chemmacros_reactions_tag_close_tl
+ }
+ #3
+ }
+ \frefformat {plain} { \fancyrefrctlabelprefix }
+ { \frefrctname \fancyrefdefaultspacing #1 }
+ \Frefformat {plain} { \fancyrefrctlabelprefix }
+ { \Frefrctname \fancyrefdefaultspacing #1 }
}
-% switch back to equation tags
-\cs_new_protected:Npn \__chemmacros_end_reaction:
+% --------------------------------------------------------------------------
+% begin and end reaction environments: switch to reaction counter:
+\cs_new_protected:Npn \__chemmacros_begin_reaction:
{
- \setcounter {reaction} { \value {equation} }
- \setcounter {equation} { \value {chemmacros_save_reaction} }
+ \bool_if:NT \l__chemmacros_reactions_counter_bool
+ {
+ \cs_set_eq:NN \r@equation \r@reaction
+ \cs_set_eq:NN \p@equation \p@reaction
+ \cs_set_eq:NN \c@equation \c@reaction
+ \chemmacros_patch_cmd:Nnn \thereaction {reaction} {equation}
+ \chemmacros_if_package_loaded:nT {cleveref}
+ { \crefalias {equation} {reaction} }
+ % this only works if nobody steps counters inside reactions:
+ \bool_if:NT \l__chemmacros_hyperref_bool
+ {
+ \chemmacros_patch_cmd:Nnn \hyper@refstepcounter
+ { \This@name }
+ { \This@name {reaction} \@gobble }
+ \chemmacros_patch_cmd:Nnn \hyper@refstepcounter
+ { \hyper@makecurrent }
+ { \hyper@makecurrent {reaction} \@gobble }
+ }
+ \usetagform {reaction}
+ }
}
-\tl_new:N \l__chemmacros_reactions_args_tl
+\cs_new_protected:Npn \__chemmacros_end_reaction:
+ { }
+% --------------------------------------------------------------------------
\cs_new_protected:Npn \__chemmacros_reactions_build_args:n #1
{ \tl_put_right:Nn \l__chemmacros_reactions_args_tl { {## #1} } }
\cs_new_protected:Npn \chemmacros_define_reaction:nnn #1#2#3
{
+ \tl_clear:N \l__chemmacros_reactions_args_tl
\int_compare:nNnT {#3+0} > {0}
- {
- \tl_clear:N \l__chemmacros_reactions_args_tl
- \int_step_function:nnnN {2} {1} {#3+1} \__chemmacros_reactions_build_args:n
- }
- \chemmacros_declare_reaction_env:nnnV {#1} {#2} {#3} \l__chemmacros_reactions_args_tl
+ { \int_step_function:nnnN {2} {1} {#3+1} \__chemmacros_reactions_build_args:n }
+ \__chemmacros_declare_reaction_env:nnnV {#1} {#2} {#3} \l__chemmacros_reactions_args_tl
}
% #1: chem
% #2: math
% #3: args number
% #4: argument list ({#2}{#3}...)
-\cs_new_protected:Npn \chemmacros_declare_reaction_env:nnnn #1#2#3#4
+\cs_new_protected:Npn \__chemmacros_declare_reaction_env:nnnn #1#2#3#4
{
\exp_args:Nnx \DeclareDocumentEnvironment {#1}
{ \int_compare:nT { #3+0 = 0 } {!} O{} \prg_replicate:nn {#3+0} {m} }
{
\chemmacros_add_reaction_description:n {##1}
\__chemmacros_begin_reaction:
- \chemmacros_reaction_read:nnw {#2} {#4}
+ \__chemmacros_reaction_read:nnw {#2} {#4}
}
{
\__chemmacros_end_reaction:
\ignorespacesafterend
}
}
-\cs_generate_variant:Nn \chemmacros_declare_reaction_env:nnnn {nnnV}
+\cs_generate_variant:Nn \__chemmacros_declare_reaction_env:nnnn {nnnV}
-\cs_new_protected:Npn \chemmacros_reaction_read:nnw #1#2#3 \end
+\cs_new_protected:Npn \__chemmacros_reaction_read:nnw #1#2#3 \end
{
\tl_clear:N \l__chemmacros_tmpa_tl
\seq_clear:N \l__chemmacros_tmpc_seq
@@ -4049,17 +4158,40 @@
{ \l__chemmacros_tmpa_int = \l__chemmacros_tmpb_int }
{ \tl_put_right:Nn \l__chemmacros_tmpa_tl {\\} }
}
- \chemmacros_reaction_write:nnV {#1} {#2} \l__chemmacros_tmpa_tl
+ \__chemmacros_reaction_write:nnV {#1} {#2} \l__chemmacros_tmpa_tl
\end
}
-\cs_new_protected:Npn \chemmacros_reaction_write:nnn #1#2#3
+\cs_new_protected:Npn \__chemmacros_reaction_write:nnn #1#2#3
{
\begin{#1}#2
#3
\end{#1}
}
-\cs_generate_variant:Nn \chemmacros_reaction_write:nnn { nnV }
+\cs_generate_variant:Nn \__chemmacros_reaction_write:nnn { nnV }
+
+\chemmacros_define_keys:nn {reactions}
+ {
+ list-name .tl_set:N = \reactionlistname ,
+ list-name .initial:n = \chemmacros_translate:n {list-of-reactions} ,
+ autoref-name .tl_set:N = \reactionautorefname ,
+ autoref-name .initial:n = \chemmacros_translate:n {Reaction} ,
+ list-entry .tl_set:N = \l__chemmacros_reaction_lorname_tl ,
+ list-entry .initial:n = \chemmacros_translate:n {Reaction} ,
+ list-heading-cmd .cs_set:Np = \__chemmacros_reaction_heading:n #1 ,
+ tocbasic .code:n = \chemmacros_deprecate_option: ,
+ own-counter .bool_set:N = \l__chemmacros_reactions_counter_bool ,
+ own-counter .initial:n = true ,
+ tag-open .tl_set:N = \l__chemmacros_reactions_tag_open_tl ,
+ tag-open .initial:n = \{ ,
+ tag-close .tl_set:N = \l__chemmacros_reactions_tag_close_tl ,
+ tag-close .initial:n = \} ,
+ before-tag .tl_set:N = \l__chemmacros_reactions_before_tag_tl
+ }
+
+\cs_if_exist:NTF \chapter
+ { \chemmacros_set_keys:nn {reactions} { list-heading-cmd = \chapter* {#1} } }
+ { \chemmacros_set_keys:nn {reactions} { list-heading-cmd = \section* {#1} } }
\NewChemMacroset* {Reaction} {mO{}m}
{ \chemmacros_define_reaction:nnn {#1} {#3} {#2} }
@@ -4068,10 +4200,10 @@
\NewChemReaction {reaction*} {equation*}
\NewChemReaction {reactions} {align}
\NewChemReaction {reactions*} {align*}
-
+
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{redox}{2020/11/29 oxidation numbers, redox reactions}
+\ChemModule{redox}{2022/01/29 oxidation numbers, redox reactions}
\RequirePackage{mathtools,relsize}
@@ -4215,7 +4347,7 @@
{ \relsize {-3} \__chemmacros_ox_process_number:n {#1} }
}
}
- \hbox_set:Nn \l__chemmacros_tmpb_box { \chemmacros_chemformula:n {#2} }
+ \hbox_set:Nn \l__chemmacros_tmpb_box { \chemmacros_formula:n {#2} }
\chemmacros_math:n
{
\bool_if:NT \l__chemmacros_ox_super_bool
@@ -4573,17 +4705,11 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{scheme}{2022/01/13 a scheme floating environment}
+\ChemModule{scheme}{2022/02/05 a scheme floating environment}
\RequirePackage {chemnum}
\RequirePackage {etoolbox}
-\msg_new:nnn {chemmacros} {patch-failed}
- {
- Patching~ \token_to_str:N #1 \c_space_tl failed.~
- Please~ inform~ the~ chemmacros~ package~ authors.
- }
-
\bool_new:N \l__chemmacros_float_def_bool
\tl_new:N \l__chemmacros_float_method_tl
\seq_new:N \l__chemmacros_float_methods_seq
@@ -4591,17 +4717,27 @@
\prop_new:N \l__chemmacros_float_definitions_prop
\msg_new:nnn {chemmacros} {float-method}
- { Detected~ float~ defining~ method~ `#1'. }
+ { Using~ float~ defining~ method~ `#1'. }
+
+\msg_new:nnn {chemmacros} {unknown-method}
+ {
+ The~ float~ method~ `#1'~ is~ not~ known~ \msg_line_contect: .~ Ckeck~
+ for~ a~ typo.
+ }
% --------------------------------------------------------------------------
% #1: name
% #2: check
+% #3: code
\cs_new_protected:Npn \chemmacros_define_float_method:nnn #1#2#3
{
\seq_put_right:Nn \l__chemmacros_float_methods_seq {#1}
\prop_put:Nnn \l__chemmacros_float_methods_prop {#1} {#2}
\prop_put:Nnn \l__chemmacros_float_definitions_prop {#1}
- { \cs_set_protected:Npn \__chemmacros_define_float:nn ##1##2 {#3} }
+ {
+ \cs_set_protected:Npn \__chemmacros_define_float:nn ##1##2
+ { \msg_info:nnn {chemmacros} {float-method} {#1} #3 }
+ }
}
% the order in which the methods are defined determines in which order the
@@ -4692,30 +4828,111 @@
{ \listof {#1} {\chemmacros_translate:n {#1-list}} }
}
+\chemmacros_define_float_method:nnn {traditional}
+ { \c_false_bool }
+ {
+ \bool_lazy_or:nnTF
+ { \chemmacros_if_class_loaded_p:n {book} }
+ { \chemmacros_if_class_loaded_p:n {report} }
+ {
+ \newcounter {#1} [chapter]
+ \cs_set:cpn {the#1}
+ { \ifnum \c@chapter>\z@ \thechapter.\fi \arabic {#1} }
+ }
+ {
+ \newcounter {#1}
+ \cs_set:cpn {the#1} { \arabic {#1} }
+ }
+ \cs_new:cpn {fps@#1} {tbp}
+ \cs_new:cpn {ftype@#1} {8}
+ \cs_new:cpn {ext@#1} {#2}
+ \cs_new:cpx {fnum@#1} {
+ \exp_not:c {#1name}
+ \exp_not:N \nobreakspace
+ \exp_not:c {the#1}}
+ \cs_new:cpn {#1name} {\chemmacros_translate:n {#1-name}}
+ \cs_new:cpn {list#1name} {\chemmacros_translate:n {#1-list}}
+ \newenvironment {#1}
+ {\@float{#1}}
+ {\end@float}
+ \newenvironment {#1*}
+ {\@dblfloat{#1}}
+ {\end@dblfloat}
+ \bool_lazy_or:nnTF
+ { \chemmacros_if_class_loaded_p:n {book} }
+ { \chemmacros_if_class_loaded_p:n {report} }
+ {
+ \cs_new_protected:cpn {listof#1s}
+ {
+ \legacy_if:nTF {@twocolumn}
+ { \@restonecoltrue\onecolumn }
+ { \@restonecolfalse }
+ \chapter* { \use:c {list#1name} }
+ \use:x
+ {
+ \exp_not:N \@mkboth
+ { \exp_not:N \MakeUppercase \exp_not:c {list#1name} }
+ { \exp_not:N \MakeUppercase \exp_not:c {list#1name} }
+ }
+ \@starttoc {#2}
+ \legacy_if:nT {@restonecol} { \twocolumn }
+ }
+ \chemmacros_patch_cmd:Nnn \@chapter
+ { \addtocontents }
+ { \addtocontents {#2} { \protect \addvspace {10\p@} } \addtocontents }
+ }
+ {
+ \cs_new_protected:cpn {listof#1s}
+ {
+ \section* {\use:c {list#1name}}
+ \use:x
+ {
+ \exp_not:N \@mkboth
+ { \exp_not:N \MakeUppercase \exp_not:c {list#1name} }
+ { \exp_not:N \MakeUppercase \exp_not:c {list#1name} }
+ }
+ \@starttoc {#2}
+ }
+ }
+ \cs_new_eq:cN {l@#1} \l@figure
+ }
+
+% --------------------------------------------------------------------------
+\chemmacros_define_keys:nn {scheme}
+ {
+ float-method .code:n =
+ \seq_if_in:NnTF \l__chemmacros_float_methods_seq {#1}
+ {
+ \bool_set_true:N \l__chemmacros_float_def_bool
+ \tl_set:Nn \l__chemmacros_float_method_tl {#1}
+ }
+ { \msg_error:nnn {chemmacros} {unknown-method} {#1} }
+ }
+
% --------------------------------------------------------------------------
% checks if one of the above defined methods is active. The first one found
-% will be used.
+% will be used.
\cs_new_protected:Npn \chemmacros_check_float_method:n #1
{
\prop_get:NnNT \l__chemmacros_float_methods_prop {#1}
\l__chemmacros_tmpa_tl
{
- \bool_lazy_and:nnT
- { !\l__chemmacros_float_def_bool }
- { \l__chemmacros_tmpa_tl }
+ \bool_if:nT { \l__chemmacros_tmpa_tl }
{
\bool_set_true:N \l__chemmacros_float_def_bool
\tl_set:Nn \l__chemmacros_float_method_tl {#1}
- \msg_info:nnn {chemmacros} {float-method} {#1}
}
}
}
\cs_new_protected:Npn \chemmacros_check_float_methods:
{
- \seq_map_function:NN
- \l__chemmacros_float_methods_seq
- \chemmacros_check_float_method:n
+ \bool_if:NF \l__chemmacros_float_def_bool
+ {
+ \seq_map_function:NN
+ \l__chemmacros_float_methods_seq
+ \chemmacros_check_float_method:n
+ }
}
\hook_gput_code:nnn {begindocument/before} {chemmacros}
@@ -4727,19 +4944,8 @@
}
}
-% --------------------------------------------------------------------------
-\ChemCleverefSupport {scheme}
- { \chemmacros_translate:n {scheme} }
- [ \chemmacros_translate:n {Scheme} ]
- { \chemmacros_translate:n {schemes} }
- [ \chemmacros_translate:n {Schemes} ]
-
-\ChemFancyrefSupport {sch}
- { \chemmacros_translate:n {scheme} }
- [ \chemmacros_translate:n {Scheme} ]
-
-% --------------------------------------------------------------------------
% #1: env name
+% #2: file ending
\cs_new_protected:Npn \chemmacros_define_float:nn #1#2
{
\bool_lazy_and:nnT
@@ -4755,81 +4961,31 @@
\__chemmacros_define_float:nn {#1} {#2}
}
{
- \bool_lazy_or:nnTF
- { \chemmacros_if_class_loaded_p:n {book} }
- { \chemmacros_if_class_loaded_p:n {report} }
- {
- \newcounter {#1} [chapter]
- \cs_set:cpn {the#1}
- { \ifnum \c@chapter>\z@ \thechapter.\fi \arabic {#1} }
- }
- {
- \newcounter {#1}
- \cs_set:cpn {the#1} { \arabic {#1} }
- }
- \cs_new:cpn {fps@#1} {tbp}
- \cs_new:cpn {ftype@#1} {8}
- \cs_new:cpn {ext@#1} {#2}
- \cs_new:cpx {fnum@#1} {
- \exp_not:c {#1name}
- \exp_not:N \nobreakspace
- \exp_not:c {the#1}}
- \cs_new:cpn {#1name} {\chemmacros_translate:n {#1-name}}
- \cs_new:cpn {list#1name} {\chemmacros_translate:n {#1-list}}
- \newenvironment {#1}
- {\@float{#1}}
- {\end@float}
- \newenvironment {#1*}
- {\@dblfloat{#1}}
- {\end@dblfloat}
- \bool_lazy_or:nnTF
- { \chemmacros_if_class_loaded_p:n {book} }
- { \chemmacros_if_class_loaded_p:n {report} }
- {
- \cs_new_protected:cpn {listof#1s}
- {
- \legacy_if:nTF {@twocolumn}
- { \@restonecoltrue\onecolumn }
- { \@restonecolfalse }
- \chapter* { \use:c {list#1name} }
- \use:x
- {
- \exp_not:N \@mkboth
- { \exp_not:N \MakeUppercase \exp_not:c {list#1name} }
- { \exp_not:N \MakeUppercase \exp_not:c {list#1name} }
- }
- \@starttoc {#2}
- \legacy_if:nT {@restonecol} { \twocolumn }
- }
- \patchcmd \@chapter
- { \addtocontents }
- { \addtocontents {#2} { \protect \addvspace {10\p@} } \addtocontents }
- {}
- { \msg_warning:nnn {chemmacros} {patch-failed} { \@chapter } }
- }
- {
- \cs_new_protected:cpn {listof#1s}
- {
- \section* {\use:c {list#1name}}
- \use:x
- {
- \exp_not:N \@mkboth
- { \exp_not:N \MakeUppercase \exp_not:c {list#1name} }
- { \exp_not:N \MakeUppercase \exp_not:c {list#1name} }
- }
- \@starttoc {#2}
- }
- }
- \cs_new_eq:cN {l@#1} \l@figure
+ \prop_get:NnN \l__chemmacros_float_definitions_prop
+ {traditional}
+ \l__chemmacros_tmpa_tl
+ \tl_use:N \l__chemmacros_tmpa_tl
+ \__chemmacros_define_float:nn {#1} {#2}
}
+ \cs_set:cpn {#1name} {\chemmacros_translate:n {#1-name}}
+ \cs_set:cpn {list#1name} {\chemmacros_translate:n {#1-list}}
}
- \cs_set:cpn {#1name} {\chemmacros_translate:n {#1-name}}
- \cs_set:cpn {list#1name} {\chemmacros_translate:n {#1-list}}
}
+
+% --------------------------------------------------------------------------
+\ChemCleverefSupport {scheme}
+ { \chemmacros_translate:n {scheme} }
+ [ \chemmacros_translate:n {Scheme} ]
+ { \chemmacros_translate:n {schemes} }
+ [ \chemmacros_translate:n {Schemes} ]
+
+\ChemFancyrefSupport {sch}
+ { \chemmacros_translate:n {scheme} }
+ [ \chemmacros_translate:n {Scheme} ]
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{spectroscopy}{2021/07/24 environment for spectroscopic data}
+\ChemModule{spectroscopy}{2022/01/29 environment for spectroscopic data}
\RequirePackage{siunitx}
@@ -4939,11 +5095,11 @@
\tl_put_right:Nn \g__chemmacros_nmr_element_coupled_tl { \} }
}
\tl_put_left:Nn \g__chemmacros_nmr_element_coupled_tl {#2}
- \chemmacros_chemformula:n { ^{#1} }
+ \chemmacros_formula:n { ^{#1} }
\tl_if_blank:VF \g__chemmacros_nmr_element_coupled_tl
{
\bool_if:NTF \l__chemmacros_nmr_parse_bool
- { \chemmacros_chemformula:V \g__chemmacros_nmr_element_coupled_tl }
+ { \chemmacros_formula:V \g__chemmacros_nmr_element_coupled_tl }
{ \g__chemmacros_nmr_element_coupled_tl }
}
\tl_use:N \l__chemmacros_nmr_element_method_connector_tl
@@ -5090,7 +5246,7 @@
\bool_if:NT \l__chemmacros_nmr_comma_bool
{ , ~ }
\bool_if:NT \l__chemmacros_nmr_solvent_bool
- { \chemmacros_chemformula:n {#4} }
+ { \chemmacros_formula:n {#4} }
\bool_if:NT \l__chemmacros_nmr_delimiters_bool
{ ) }
\tl_if_blank:nT {#1} {:~}
@@ -5118,7 +5274,7 @@
\bool_if:NT \l__chemmacros_nmr_solvent_bool
{
\bool_if:NTF \l__chemmacros_nmr_parse_bool
- { \chemmacros_chemformula:n {#4} }
+ { \chemmacros_formula:n {#4} }
{#4}
}
\bool_if:NT \l__chemmacros_nmr_delimiters_bool
@@ -5184,12 +5340,12 @@
{
\__chemmacros_nmr_number:n {#1}
\chemmacros_skip_nobreak:N \l__chemmacros_nmr_space_skip
- \chemmacros_chemformula:V \g__chemmacros_nmr_element_tl
+ \chemmacros_formula:V \g__chemmacros_nmr_element_tl
}
\cs_new_protected:Npn \chemmacros_nmr_position:n #1
{
- \chemmacros_chemformula:x
+ \chemmacros_formula:e
{
\exp_not:V \g__chemmacros_nmr_element_tl
\bool_if:NF \l__chemmacros_nmr_position_side_bool
@@ -5229,7 +5385,7 @@
\c_math_subscript_token
{
\l__chemmacros_nmr_coupling_nuclei_pre_tl
- \chemmacros_chemformula:n {#2}
+ \chemmacros_formula:n {#2}
\l__chemmacros_nmr_coupling_nuclei_post_tl
}
}
@@ -5238,7 +5394,7 @@
\tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl
{
\l__chemmacros_nmr_coupling_nuclei_pre_tl
- \chemmacros_chemformula:n {#2}
+ \chemmacros_formula:n {#2}
\l__chemmacros_nmr_coupling_nuclei_post_tl
}
}
@@ -5321,16 +5477,17 @@
unit .groups:n = {variables}
}
-\cs_new_protected:Npn \chemmacros_state:nn #1#2
+\cs_new_protected:Npn \chemmacros_state:nnnnnn #1#2#3#4#5#6
{
- % pre (\Delta)
- % post
- % superscript-left
- % superscript-right (\standardstate)
- % subscript-left
- % subscript-right
\group_begin:
- \chemmacros_set_keys:nn {thermodynamics} {#1}
+ \chemmacros_set_keys:ne {thermodynamics}
+ {
+ \exp_not:n {#1} ,
+ \tl_if_novalue:nF {#2} { subscript-left = \exp_not:n {#2} , }
+ \tl_if_novalue:nF {#3} { superscript-left = \exp_not:n {#3} , }
+ \tl_if_novalue:nF {#5} { subscript-right = \exp_not:n {#5} , }
+ \tl_if_novalue:nF {#6} { superscript-right = \exp_not:n {#6} }
+ }
\ensuremath
{
\chemmacros_text:V \l__chemmacros_state_pre_tl
@@ -5338,7 +5495,7 @@
{ \chemmacros_text:V \l__chemmacros_state_sp_left_tl }
\c_math_subscript_token
{ \chemmacros_text:V \l__chemmacros_state_sb_left_tl }
- #2
+ #4
\c_math_superscript_token
{ \chemmacros_text:V \l__chemmacros_state_sp_right_tl }
\c_math_subscript_token
@@ -5347,10 +5504,11 @@
}
\group_end:
}
-\cs_generate_variant:Nn \chemmacros_state:nn { nV }
+\cs_generate_variant:Nn \chemmacros_state:nnnnnn { nVVVVV }
-\DeclareDocumentCommand \state { O{}m }
- { \chemmacros_state:nn {#1} {#2} }
+\exp_args:NNe
+\NewDocumentCommand \state { O{}e{\char_generate:nn {`_}{8}^}me{\char_generate:nn {`_}{8}^} }
+ { \use:c {chemmacros_state:nnnnnn} {#1} {#2} {#3} {#4} {#5} {#6} }
\cs_new_protected:Npn \chemmacros_declare_state:Nn #1#2
{
@@ -5374,17 +5532,23 @@
\DeclareDocumentCommand #1 { sO{}D(){}m }
{
\group_begin:
- \chemmacros_set_keys:xn
+ \chemmacros_set_keys:en
{thermodynamics/\chemmacros_remove_backslash:N #1}
{#2}
\tl_if_blank:nF {##3}
{
- \chemmacros_set_keys:nx {thermodynamics}
+ \chemmacros_set_keys:ne {thermodynamics}
{ subscript-\l__chemmacros_state_sb_pos_tl = \exp_not:n {##3} }
}
\ensuremath
{
- \chemmacros_state:nV {##2} \l__chemmacros_state_symbol_tl
+ \chemmacros_state:nVVVVV
+ {##2}
+ \c_novalue_tl
+ \c_novalue_tl
+ \l__chemmacros_state_symbol_tl
+ \c_novalue_tl
+ \c_novalue_tl
\chemmacros_set_keys_groups:nnn {thermodynamics} {variables} {##2}
\IfBooleanF {##1} { = \qty {##4} { \l__chemmacros_state_unit_tl } }
}
@@ -6452,8 +6616,8 @@
% #1: star: include ID in table
\NewDocumentCommand \printreactants {s}
{
- \group_begin:
- \chemmacros_set_keys:nn {reactants} { switch = false }
+ \group_begin:
+ \chemmacros_set_keys:nn {reactants} { switch = false }
\int_step_variable:nNn
{ \seq_count:N \g_chemnum_initiated_compounds_seq }
\l__chemmacros_reactants_tmpa_tl
@@ -6509,60 +6673,54 @@
\chemmacros_if_package_loaded:nTF {xltabular}
{
\bool_if:nTF {#1}
- {
- \begin
- {xltabular}
- { \textwidth }
- { @{}ll>{\raggedright\arraybackslash}X@{} }
- }
- {
- \begin
- {xltabular}
- { \textwidth }
- { @{}l>{\raggedright\arraybackslash}X@{} }
- }
- \seq_use:Nn \l__chemmacros_reactants_tmpa_seq { }
- \end{xltabular}
- }
- {
+ {
+ \begin {xltabular}
+ { \textwidth }
+ { @{}ll>{\raggedright\arraybackslash}X@{} }
+ }
+ {
+ \begin {xltabular}
+ { \textwidth }
+ { @{}l>{\raggedright\arraybackslash}X@{} }
+ }
+ \seq_use:Nn \l__chemmacros_reactants_tmpa_seq { }
+ \end{xltabular}
+ }
+ {
\msg_expandable_error:nnnn
{chemmacros}
{package-not-loaded}
{ \printreactants }
{xltabular}
- }
- }
+ }
+ }
{longtable}
{
\chemmacros_if_package_loaded:nTF {longtable}
{
\bool_if:nTF {#1}
- {
- \begin
- {longtable}[l]
- { @{}ll>{\raggedright\arraybackslash}p{0.6\textwidth}@{} }
- }
- {
- \begin
- {longtable}[l]
+ {
+ \begin {longtable}[l]
+ { @{}ll>{\raggedright\arraybackslash}p{0.6\textwidth}@{} }
+ }
+ {
+ \begin {longtable}[l]
{ @{}l>{\raggedright\arraybackslash}p{0.9\textwidth}@{} }
- }
- \seq_use:Nn \l__chemmacros_reactants_tmpa_seq { }
- \end{longtable}
- }
- {
+ }
+ \seq_use:Nn \l__chemmacros_reactants_tmpa_seq { }
+ \end{longtable}
+ }
+ {
\msg_expandable_error:nnnn
{chemmacros}
{package-not-loaded}
{ \printreactants }
{longtable}
- }
- }
- }
- }
- {
- \msg_warning:nn {chemmacros} {missing-printreactants-style}
- }
+ }
+ }
+ }
+ }
+ { \msg_warning:nn {chemmacros} {missing-printreactants-style} }
\group_end:
}
@@ -6615,7 +6773,7 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{translations}{2022/01/16 translations for defined keys at one place}
+\ChemModule{translations}{2022/01/26 translations for defined keys at one place}
% --------------------------------------------------------------------------
\chemmacros_declare_translations:nn {K-acid}
@@ -6625,7 +6783,7 @@
Dutch = \mathrm {z}
}
-\chemmacros_declare_translations:nn {K-acid}
+\chemmacros_declare_translations:nn {K-water}
{ Danish = \mathrm {v} }
% --------------------------------------------------------------------------