summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-06-25 20:56:15 +0000
committerKarl Berry <karl@freefriends.org>2018-06-25 20:56:15 +0000
commit8abada29009890b3f73568d9bcefffbdacaaf0a0 (patch)
tree24fb4cd6fe328bb3386ccbcbde0703fc8cf4f8bc /Master/texmf-dist/tex/latex
parent9bb712f8fc9e7900a46230fa2430e0c0beaa8806 (diff)
mhchem (25jun18)
git-svn-id: svn://tug.org/texlive/trunk@48088 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/mhchem/mhchem.sty45
1 files changed, 21 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/mhchem/mhchem.sty b/Master/texmf-dist/tex/latex/mhchem/mhchem.sty
index 227372cdca1..594b5e6d0e6 100644
--- a/Master/texmf-dist/tex/latex/mhchem/mhchem.sty
+++ b/Master/texmf-dist/tex/latex/mhchem/mhchem.sty
@@ -1,5 +1,5 @@
%% mhchem.sty
-%% Copyright 2004-2017 Martin Hensel
+%% Copyright 2004-2018 Martin Hensel
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c
@@ -27,7 +27,7 @@
% This work consists of all files listed in manifest.txt.
%
%
-\ProvidesPackage{mhchem}[2017/07/24 v4.07 for typesetting chemical formulae]
+\ProvidesPackage{mhchem}[2018/06/22 v4.08 for typesetting chemical formulae]
\RequirePackage{expl3}
\RequirePackage{l3keys2e}
\RequirePackage{calc}[1998/07/07]
@@ -2335,7 +2335,7 @@
\l__mhchem_regex_bracedGroup_fregex
{#1}
{
- \__mhchem_output_escapeFromMathToItalicMath:n {#1}
+ \__mhchem_output_escapeToItalicMath:n {#1}
}
% else
{
@@ -2346,10 +2346,11 @@
\group_begin:
\bool_if:NTF \l__mhchem_output_isMathMode_bool
{
- \thinmuskip=0mu
- \medmuskip=0mu
- \thickmuskip=0mu
- \__mhchem_output_escapeFromMathToItalicMath:n {#1}
+ \text { \ensuremath
+ {
+ \thinmuskip=0mu \medmuskip=0mu \thickmuskip=0mu
+ \__mhchem_output_escapeFromMathToItalicMath:n {#1}
+ } }
}
{
\tl_set:Nn \l__mhchem_cg_withinMathTokens_tmpa_tl { #1 }
@@ -2370,9 +2371,7 @@
\group_end:
}
{
- \bool_if:NTF \l__mhchem_output_isMathMode_bool
- { \__mhchem_output_escapeFromMathToItalicMath:n {#1} }
- { \__mhchem_output_escapeFromTextToItalicMath:n {#1} }
+ \__mhchem_output_escapeToItalicMath:n {#1}
}
}
}
@@ -2486,7 +2485,7 @@
{
\regex_replace_all:NnN
\l__mhchem_regex_oneLowercaseLetter_regex
- { \c{__mhchem_output_withFont:n}\cB[ \c{__mhchem_cg_itshape:n}\cB[ \0 \cE]\cE] }
+ { \c{__mhchem_cg_itshape:n}\cB[ \0 \cE] }
#1
\regex_replace_all:NnN
\l__mhchem_regex_hyphen_regex
@@ -2938,19 +2937,13 @@
{
\bool_if:NTF \l__mhchem_output_isMathMode_bool
{ \__mhchem_output_escapeFromMathToItalicMath:n {#1} }
- { \__mhchem_output_escapeFromTextToItalicMath:n {#1} }
+ { \ensuremath { \mhchem@hook@beforeItalicMath #1 } }
}
\cs_new_protected:Npn \__mhchem_output_escapeFromMathToItalicMath:n #1
{
- \text { \__mhchem_output_escapeFromTextToItalicMath:n {#1} }
- }
-\cs_new_protected:Npn \__mhchem_output_escapeFromTextToItalicMath:n #1
- {
- \ensuremath
- {
- \mhchem@hook@beforeItalicMath
- #1
- }
+ \bool_if:NTF \l__mhchem_option_unicodemath_bool
+ { \text { \ensuremath { \symit { \mhchem@hook@beforeItalicMath #1 } } } }
+ { \text { \ensuremath { \mhchem@hook@beforeItalicMath #1 } } }
}
\cs_new_protected:Npn \__mhchem_output_skipAfterAmount:
@@ -3022,9 +3015,9 @@
{ \smash{\raisebox{-0.4em}{\scalebox{1.3}{*}}} }
}
\cs_new_protected:Npn \__mhchem_output_commaDecimal:
- { \__mhchem_output_withFont:n { , } }
+ { \__mhchem_output_withFont:n { {,} } }
\cs_new_protected:Npn \__mhchem_output_commaEnumeration:
- { \__mhchem_output_withFont:n { , } \ensuremath { \mkern3mu } }
+ { \__mhchem_output_withFont:n { {,} } \ensuremath { \mkern3mu } }
\cs_new_protected:Npn \__mhchem_output_commaAuto:
{
\__mhchem_regex_peek:NTF \l__mhchem_regex_digit_pregex
@@ -3032,7 +3025,7 @@
{ \__mhchem_output_commaEnumeration: }
}
\cs_new_protected:Npn \__mhchem_output_commaEnumerationSmall:
- { \__mhchem_output_withFont:n { , } \ensuremath { \mkern1mu } }
+ { \__mhchem_output_withFont:n { {,} } \ensuremath { \mkern1mu } }
\cs_new_protected:Npn \__mhchem_output_commaAutoSmall:
{
\__mhchem_regex_peek:NTF \l__mhchem_regex_digit_pregex
@@ -3402,6 +3395,7 @@
{ \mhchemoptions{layout=staggered-flat} }
}
+\bool_new:N \l__mhchem_option_unicodemath_bool
\AtBeginDocument
{
\bool_if:nF \l__mhchem_option_textgreekSelectedByUser_bool
@@ -3412,6 +3406,9 @@
{
\chemgreek_declare_mapping_alias:nn { mhchem-math } { \l_chemgreek_active_mapping_tl }
}
+ \@ifpackageloaded {unicode-math}
+ { \bool_set_true:N \l__mhchem_option_unicodemath_bool }
+ { \bool_set_false:N \l__mhchem_option_unicodemath_bool }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%