summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty')
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty68
1 files changed, 57 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
index e925819baf0..ef22313ddd7 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
+++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
@@ -5,7 +5,7 @@
% - macros and commands for chemists - %
% --------------------------------------------------------------------------- %
% - Clemens Niederberger - %
-% - 2012/05/07 - %
+% - 2012/05/13 - %
% --------------------------------------------------------------------------- %
% - https://bitbucket.org/cgnieder/chemmacros/ - %
% - contact@mychemistry.eu - %
@@ -33,8 +33,8 @@
\ProvidesExplPackage
{chemmacros}
- {2012/05/07}
- {3.3}
+ {2012/05/13}
+ {3.3a}
{macros and commands for chemists}
\@ifpackageloaded { chemformula } {} { \RequirePackage { chemformula } }
@@ -276,6 +276,7 @@
\cs_set_nopar:Npn \Chemdelta { \ensuremath { \updelta } }
\cs_set_nopar:Npn \Chemepsilon { \ensuremath { \upvarepsilon } }
\cs_set_nopar:Npn \Chemeta { \ensuremath { \upeta } }
+ \cs_set_nopar:Npn \Chemkappa { \ensuremath { \upkappa } }
\cs_set_nopar:Npn \Chemmu { \ensuremath { \upmu } }
\cs_set_nopar:Npn \Chemnu { \ensuremath { \upnu } }
\cs_set_nopar:Npn \Chemrho { \ensuremath { \uprho } }
@@ -299,6 +300,8 @@
{ \ensuremath { \text { \textepsilon } } }
\cs_set_nopar:Npn \Chemeta
{ \ensuremath { \text { \texteta } } }
+ \cs_set_nopar:Npn \Chemkappa
+ { \ensuremath { \text { \textkappa } } }
\cs_set_nopar:Npn \Chemmu
{ \ensuremath { \text { \textmu } } }
\cs_set_nopar:Npn \Chemnu
@@ -323,6 +326,7 @@
\cs_new_nopar:Npn \Chemdelta { \ensuremath { \delta } }
\cs_new_nopar:Npn \Chemepsilon { \ensuremath { \varepsilon } }
\cs_new_nopar:Npn \Chemeta { \ensuremath { \eta } }
+\cs_set_nopar:Npn \Chemkappa { \ensuremath { \kappa } }
\cs_new_nopar:Npn \Chemmu { \ensuremath { \mu } }
\cs_new_nopar:Npn \Chemnu { \ensuremath { \nu } }
\cs_new_nopar:Npn \Chemrho { \ensuremath { \rho } }
@@ -526,11 +530,18 @@
\cs_generate_variant:Nn \chemmacros_tikz_node_in_draw:n { f,x }
% --------------------------------------------------------------------------- %
+% general functions
+\cs_new_protected_nopar:Npn \chemmacros_leave_vmode:
+ { \hbox_unpack:N \c_empty_box }
+\cs_new_eq:NN \chemmacros_ignore_spaces: \tex_ignorespaces:D
+
+% --------------------------------------------------------------------------- %
% circled charge signs
\cs_new_nopar:Npn \chemmacros_fplus:
{ \ensuremath { \chemmacros_fplus_aux_i: } }
\cs_new_nopar:Npn \chemmacros_fplus_aux_i:
{ \mathpalette \chemmacros_fplus_aux_ii: \bigcirc }
+% TODO: can I rewrite this in a more "expl3-way"?
\cs_new_nopar:Npn \chemmacros_fplus_aux_ii: #1#2
{
\ooalign
@@ -1067,6 +1078,36 @@
\DeclareChemIUPAC \syn { \textit { syn } }
\DeclareChemIUPAC \anti { \textit { anti } }
+% coordination chemistry
+\bool_new:N \l_chemmacros_bridge_super_bool
+\keys_define:nn { chemmacros / iupac }
+ {
+ 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 .default:n = true
+ }
+
+\cs_new_nopar:Npn \chemformula_hapto:n #1
+ { \Chemeta \chemformula_superscript:n { #1 } \chemmacros_break_point_hyphen: }
+
+\cs_new_nopar:Npn \chemformula_bridge:n #1
+ {
+ \Chemmu \tl_if_blank:nF { #1 }
+ {
+ \bool_if:NTF \l_chemmacros_bridge_super_bool
+ { \chemformula_superscript:n { #1 } }
+ { \chemformula_subscript:n { #1 } }
+ }
+ \chemmacros_break_point_hyphen:
+ }
+
+\DeclareChemIUPAC \hapto { \chemformula_hapto:n }
+\DeclareChemIUPAC \bridge { \chemformula_bridge:n }
+
% attachments to heteroatoms / added hydrogen
\DeclareChemIUPAC \H { \textit { H } }
\DeclareChemIUPAC \O { \textit { O } }
@@ -1085,11 +1126,14 @@
}
% greek letters
-\DeclareChemIUPAC\a{\Chemalpha}
-\DeclareChemIUPAC\b{\Chembeta}
-\DeclareChemIUPAC\g{\Chemgamma}
-\DeclareChemIUPAC\d{\Chemdelta}
-\DeclareChemIUPAC\w{\Chemomega}
+\DeclareChemIUPAC \a { \Chemalpha }
+\DeclareChemIUPAC \b { \Chembeta }
+\DeclareChemIUPAC \g { \Chemgamma }
+\DeclareChemIUPAC \d { \Chemdelta }
+\DeclareChemIUPAC \k { \Chemkappa }
+\DeclareChemIUPAC \m { \Chemmu }
+\DeclareChemIUPAC \n { \Chemeta }
+\DeclareChemIUPAC \w { \Chemomega }
% \iupac (basically the same as bpchem's \IUPAC)
% - allows multiple breaking points as compound names can get really long and
@@ -1142,7 +1186,7 @@
\group_begin:
\bool_set_true:N \l_chemmacros_inside_iupac_bool
\chemmacros_make_iupac:
- \tex_ignorespaces:D
+ \chemmacros_ignore_spaces:
\cs_set_eq:NN \- \chemmacros_break_point_hyphen:
\cs_set_eq:NN \| \chemmacros_break_point:
\cs_set_eq:NN \^ \chemformula_superscript:n
@@ -1885,7 +1929,7 @@
{
\bool_if:NT \l_chemmacros_nmr_list_bool { \item \scan_stop: }
\group_begin:
- \leavevmode
+ \chemmacros_leave_vmode:
\bool_set_false:N \l_chemmacros_nmr_frequency_bool
\bool_set_false:N \l_chemmacros_nmr_solvent_bool
\IfNoValueF { #3 }
@@ -2018,7 +2062,7 @@
\bool_if:NT \l_chemmacros_nmr_list_bool
{ \endlist }
\group_end:
- \ignorespaces
+ \chemmacros_ignore_spaces:
}
\cs_new:Npn \chemmacros_nmr_number:n #1
@@ -3722,6 +3766,8 @@ Version history
- 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
% --------------------------------------------------------------------------- %
% TODO: