summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty')
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty48
1 files changed, 32 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty b/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty
index e82ac0b0dcc..7c85ca96765 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty
+++ b/Master/texmf-dist/tex/latex/chemmacros/ghsystem.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 - %
@@ -30,8 +30,8 @@
\RequirePackage{ expl3 }
\ProvidesExplPackage
{ghsystem}
- {2012/05/07}
- {3.3}
+ {2012/05/13}
+ {3.3a}
{globally harmonised system}
% --------------------------------------------------------------------------- %
@@ -139,16 +139,23 @@
% language settings
\bool_new:N \l_ghsystem_language_file_loaded_bool
-\bool_if:NT \l_chemmacros_english_bool
+\prop_map_inline:Nn \l_chemmacros_language_prop
{
- \bool_set_true:N \l_ghsystem_language_file_loaded_bool
- \input { language / ghsystem_english.def } \ExplSyntaxOn
- }
-\bool_if:NT \l_chemmacros_german_bool
- {
- \bool_set_true:N \l_ghsystem_language_file_loaded_bool
- \input { language / ghsystem_german.def } \ExplSyntaxOn
+ \bool_if:cT { l_chemmacros_#1_bool }
+ {
+ \file_if_exist:nTF { language / ghsystem_#2.def }
+ {
+ \bool_set_true:N \l_ghsystem_language_file_loaded_bool
+ \input { language / ghsystem_#2.def } \ExplSyntaxOn
+ }
+ { \input { language / ghsystem_english.def } \ExplSyntaxOn }
+ }
}
+% \bool_if:NT \l_chemmacros_german_bool
+% {
+% \bool_set_true:N \l_ghsystem_language_file_loaded_bool
+% \input { language / ghsystem_german.def } \ExplSyntaxOn
+% }
% \bool_if:NT \l_chemmacros_italian_bool
% {
% \bool_set_true:N \l_ghsystem_language_file_loaded_bool
@@ -367,7 +374,6 @@
\int_zero:N \l_tmpb_int
\prop_map_inline:Nn \l_ghsystem_p_prop { \int_incr:N \l_tmpa_int }
\dim_set_eq:NN \tabulinesep \l_ghsystem_table_line_sep_dim
-% \taburowcolors [2] 2{white .. gray!15}
\begin { longtabu } { X[3]X[7,L] }
\caption [ \l_ghsystem_table_caption_short_tl ]
{
@@ -393,8 +399,15 @@
{ \ghsystem_read_number:nn { H } { ##1 } & ##2 \\ }
\prop_map_inline:Nn \l_ghsystem_euh_prop
{ \ghsystem_read_number:nn { EUH } { ##1 } & ##2 \\ }
+ \int_zero:N \l_tmpa_int
+ \prop_map_inline:Nn \l_ghsystem_p_prop { \int_gincr:N \l_tmpa_int }
+ \int_zero:N \l_tmpb_int
\prop_map_inline:Nn \l_ghsystem_p_prop
- { \ghsystem_read_number:nn { P } { ##1 } & ##2 \\ }
+ {
+ \int_gincr:N \l_tmpb_int
+ \ghsystem_read_number:nn { P } { ##1 } & ##2
+ \int_compare:nNnT { \l_tmpb_int } < { \l_tmpa_int } { \\ }
+ }
\end { longtabu }
\group_end:
}
@@ -403,12 +416,12 @@
{
\tl_if_in:nnTF { #2 } { + }
{ \ghsystem_read_number_aux_i:w #1 , #2 \q_stop }
- { #1#2 }
+ { #1 \tl_use:N \l_ghsystem_number_space_tl #2 }
}
\cs_new:Npn \ghsystem_read_number_aux_i:w #1,#2+#3\q_stop
{
- #1#2 ~+~
+ #1 \tl_use:N \l_ghsystem_number_space_tl #2 ~+~
\tl_if_in:nnTF { #3 } { + }
{ \ghsystem_read_number_aux_ii:w #1,#3 \q_stop }
{ #1#3 }
@@ -474,7 +487,10 @@ VERSION HISTORY
2012/03/20 - version 3.2 - changes in packages chemformula and chemmacros
2012/05/07 - version 3.3 - changes in packages chemformula and chemmacros
- support for chemmacros' new language settings
+2012/05/13 - version 3.3a - Italian translations of the H, EUH and P statements
+ - removed erroneous empty line at the end of the table
+ created by \ghslistall
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO:
-- add option to switch between `longtable` and `supertabular` for \ghslistall \ No newline at end of file
+- add option to switch between `longtable` and `supertabular` for \ghslistall ? \ No newline at end of file