summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemgreek
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-16 20:45:15 +0000
committerKarl Berry <karl@freefriends.org>2015-03-16 20:45:15 +0000
commit780d11aa67a2c4ea9d9279e9e20e812779b57741 (patch)
tree24287109e9b62b6efdbfc434998720e26d6cfe67 /Master/texmf-dist/tex/latex/chemgreek
parentf68a09e627785569930a286e3881dd8c91a09cad (diff)
chemgreek (16mar15)
git-svn-id: svn://tug.org/texlive/trunk@36530 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemgreek')
-rw-r--r--Master/texmf-dist/tex/latex/chemgreek/chemgreek.sty105
1 files changed, 57 insertions, 48 deletions
diff --git a/Master/texmf-dist/tex/latex/chemgreek/chemgreek.sty b/Master/texmf-dist/tex/latex/chemgreek/chemgreek.sty
index 027263dce85..14e477c3e05 100644
--- a/Master/texmf-dist/tex/latex/chemgreek/chemgreek.sty
+++ b/Master/texmf-dist/tex/latex/chemgreek/chemgreek.sty
@@ -12,7 +12,7 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-% Copyright 2011-2014 Clemens Niederberger
+% Copyright 2011-2015 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -27,8 +27,8 @@
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
\RequirePackage{expl3,xparse}
-\def\chemgreek@version{0.5}
-\def\chemgreek@date{2014/08/07}
+\def\chemgreek@version{0.5a}
+\def\chemgreek@date{2015/03/13}
\ProvidesExplPackage{chemgreek}{\chemgreek@date}{\chemgreek@version}
{interface for upright greek letters for use in chemistry (CN)}
@@ -70,8 +70,7 @@
% ----------------------------------------------------------------------------
% messages
-\msg_new:nnnn { chemgreek } { mapping-not-defined }
- { The~ mapping~ `#1'~ does~ not~ exist~ \msg_line_context: }
+\msg_new:nnn { chemgreek } { mapping-not-defined }
{
You~ chose~ the~ mapping~ `#1'~ \msg_line_context: \c_space_tl which~ has~
apparently~ not~ been~ defined,~ yet.~ If~ this~ is~ due~ to~ a~
@@ -80,8 +79,7 @@
\declarechemgreekmapping .
}
-\msg_new:nnnn { chemgreek } { mapping-already-defined }
- { The~ mapping~ `#1'~ does~ already~ exist~ \msg_line_context: }
+\msg_new:nnn { chemgreek } { mapping-already-defined }
{
It~ seems~ you're~ trying~ to~ define~ the~ mapping~ `#1'~
\msg_line_context: .~ However,~ this~ mapping~ does~ already~ exist.~ If~
@@ -89,22 +87,13 @@
via~ \token_to_str:N \renewchemgreekmapping .
}
-\msg_new:nnnn { chemgreek } { mapping-active }
- {
- The~ mapping~ `#1'~ already~ is~ active~ \msg_line_context: .~ I'm~ doing~
- nothing.
- }
+\msg_new:nnn { chemgreek } { mapping-active }
{
The~ mapping~ `#1'~ already~ is~ active~ \msg_line_context: .~ I'm~ doing~
nothing.
}
-\msg_new:nnnn { chemgreek } { package-missing }
- {
- You've~ activated~ mapping~ `#1'~ which~ needs~ package~ `#2'~ loaded.~
- However, package~ `#2'~ does~ not~ seem~ to~ be~ loaded~
- \msg_line_context: .~ If~ I'm~ mistaken~ then~ ignore~ this~ warning.
- }
+\msg_new:nnn { chemgreek } { package-missing }
{
You've~ activated~ mapping~ `#1'~ which~ needs~ package~ `#2'~ loaded.~
However,~ package~ `#2'~ does~ not~ seem~ to~ be~ loaded~
@@ -112,30 +101,23 @@
work.~ If~ I'm~ mistaken~ then~ ignore~ this~ warning.
}
-\msg_new:nnnn { chemgreek } { command-deprecated }
+\msg_new:nnn { chemgreek } { command-dropped }
{
- The~ command~ \token_to_str:N #1 is~ deprecated.~ Use~ \token_to_str:N #2
- instead~ \msg_line_context: .~ \token_to_str:N #1 may~ be~ dropped~ in~
- the~ future~ without~ further~ warning.
- }
- {
- The~ command~ \token_to_str:N #1 is~ deprecated.~ Use~ \token_to_str:N #2
- instead~ \msg_line_context: .~ \token_to_str:N #1 may~ be~ dropped~ in~
- the~ future~ without~ further~ warning.
+ The~ command~ \token_to_str:N #1 has~ been~ dropped.~ Use~ \token_to_str:N #2
+ instead~ \msg_line_context: .
}
% ----------------------------------------------------------------------------
-% define a deprecated command with hints to the corresponding new one:
-\cs_new_protected:Npn \chemgreek_define_deprecated:NN #1#2
+% define a dropped command with hints to the corresponding new one:
+\cs_new_protected:Npn \chemgreek_define_dropped:NN #1#2
{
\cs_new_protected:Npn #1
{
- \msg_warning:nnnn { chemgreek } { command-deprecated }
+ \msg_error:nnnn { chemgreek } { command-dropped }
{ #1 } { #2 }
- #2
}
}
-\cs_generate_variant:Nn \chemgreek_define_deprecated:NN { cc }
+\cs_generate_variant:Nn \chemgreek_define_dropped:NN { cc }
% ----------------------------------------------------------------------------
% a tokenlist constant that will be used to build the mapping property lists
@@ -338,9 +320,14 @@
}
\tl_map_inline:Nn \c__chemgreek_alphabet_tl
{
- \cs_set_protected:cpx { chem \tl_expandable_uppercase:n ##1 }
+ \cs_set_protected:cpx
+ {
+ chem
+ \str_upper_case:f { \tl_head:n {##1} }
+ \str_lower_case:f { \tl_tail:n {##1} }
+ }
{ \prop_get:cn { l__chemgreek_uppercase_mapping_#1_prop } { ##1 } }
- \cs_set_protected:cpx { chem ##1 }
+ \cs_set_protected:cpx { chem \str_lower_case:f {##1} }
{ \prop_get:cn { l__chemgreek_lowercase_mapping_#1_prop } { ##1 } }
}
\prop_get:NnNT \l__chemgreek_changed_mappings_prop
@@ -406,13 +393,15 @@
\iow_log:x
{
. \c_space_tl \c_space_tl \c_space_tl \c_space_tl \c_space_tl
- ##1 ~ => ~
+ \str_lower_case:f {##1} ~ => ~
\prop_get:cn { l__chemgreek_lowercase_mapping_#1_prop } { ##1 }
}
\iow_log:x
{
. \c_space_tl \c_space_tl \c_space_tl \c_space_tl \c_space_tl
- \tl_expandable_uppercase:n ##1 ~ => ~
+ \str_upper_case:f { \tl_head:n {##1} }
+ \str_lower_case:f { \tl_tail:n {##1} }
+ \c_space_tl => ~
\prop_get:cn { l__chemgreek_uppercase_mapping_#1_prop } { ##1 }
}
}
@@ -425,8 +414,13 @@
{
\tl_map_inline:Nn \c__chemgreek_alphabet_tl
{
- \use:c { chem ##1 }
- \use:c { chem \tl_expandable_uppercase:n ##1 }
+ \use:c { chem \str_lower_case:f {##1} }
+ \use:c
+ {
+ chem
+ \str_upper_case:f { \tl_head:n {##1} }
+ \str_lower_case:f { \tl_tail:n {##1} }
+ }
\c_space_tl
}
\tex_unskip:D
@@ -435,20 +429,24 @@
\cs_new_eq:NN \printchemgreekalphabet \chemgreek_print_alphabet:
% ----------------------------------------------------------------------------
-% deprecate old macro names that started with an uppercase C:
-\cs_new_protected:Npn \chemgreek_deprecate_symbol:n #1
- { \chemgreek_define_deprecated:cc { Chem#1 } { chem#1 } }
+% drop old macro names that started with an uppercase C:
+\cs_new_protected:Npn \chemgreek_drop_symbol:n #1
+ { \chemgreek_define_dropped:cc { Chem#1 } { chem#1 } }
-\cs_new_protected:Npn \chemgreek_deprecate_symbols:
+\cs_new_protected:Npn \chemgreek_drop_symbols:
{
\tl_map_inline:Nn \c__chemgreek_alphabet_tl
{
- \chemgreek_deprecate_symbol:n { ##1 }
- \chemgreek_deprecate_symbol:n { \tl_expandable_uppercase:n ##1 }
+ \chemgreek_drop_symbol:n { ##1 }
+ \chemgreek_drop_symbol:n
+ {
+ \str_upper_case:f { \tl_head:n {##1} }
+ \str_lower_case:f { \tl_tail:n {##1} }
+ }
}
}
-\chemgreek_deprecate_symbols:
+\chemgreek_drop_symbols:
% ----------------------------------------------------------------------------
% functions to format integers with greek letters; these are basically copies
@@ -835,8 +833,16 @@
\tl_map_inline:Nn \c__chemgreek_alphabet_tl
{
\cs_set_eq:cc
- { chem \tl_expandable_uppercase:n #1 }
- { text \tl_expandable_uppercase:n #1 }
+ {
+ chem
+ \str_upper_case:f { \tl_head:n {#1} }
+ \str_lower_case:f { \tl_tail:n {#1} }
+ }
+ {
+ text
+ \str_upper_case:f { \tl_head:n {#1} }
+ \str_lower_case:f { \tl_tail:n {#1} }
+ }
\cs_set_eq:cc { chem #1 } { text #1 }
}
}
@@ -872,7 +878,10 @@ HISTORY:
- \showchemgreekmapping now writes information to the log
2014/01/29 - v0.4 - add mapping `fontspec'
- new command \printchemgreekalphabet
-2014/08/07 - v0.5 - split from `chemmacros' bundle as independent package
+2014/08/08 - v0.5 - split from `chemmacros' bundle as independent package
+2015/03/13 - v0.5a - adapt to expl3's new case changing functions
+ - change status of \Chem... macros from deprecated to
+ dropped
TODO: