diff options
author | Karl Berry <karl@freefriends.org> | 2014-06-30 22:33:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-06-30 22:33:28 +0000 |
commit | 53e69d1db92ec88a11052f0899d0d6d926a99ea3 (patch) | |
tree | 943014801778b094a8ef8e263b4e5a4ed66192ef /Master/texmf-dist/tex/latex/endiagram | |
parent | a09f2d1368b9d0c8a5b07fed447fa7bb54895111 (diff) |
endiagram (29jun14)
git-svn-id: svn://tug.org/texlive/trunk@34486 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/endiagram')
-rw-r--r-- | Master/texmf-dist/tex/latex/endiagram/endiagram.sty | 134 |
1 files changed, 79 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/latex/endiagram/endiagram.sty b/Master/texmf-dist/tex/latex/endiagram/endiagram.sty index 1d4e164062e..d23f5660118 100644 --- a/Master/texmf-dist/tex/latex/endiagram/endiagram.sty +++ b/Master/texmf-dist/tex/latex/endiagram/endiagram.sty @@ -32,10 +32,24 @@ \usetikzlibrary{calc} \ProvidesExplPackage {endiagram} - {2013/04/18} - {0.1c} + {2014/06/28} + {0.1d} {Easy creation of potential energy curve diagrams} +% -------------------------------------------------------------------------- +% check expl3 version: +\@ifpackagelater { expl3 } { 2013/12/14 } + { } + { + \PackageError { endiagram } { Support~package~expl3~too~old } + { + You~need~to~update~your~installation~of~the~bundles~'l3kernel'~and~ + 'l3packages'.\MessageBreak + Loading~endiagram~will~abort! + } + \tex_endinput:D + } + % --------------------------------------------------------------------------- % % error and warning messages \msg_new:nnnn { ENdiagram } { points-missing } @@ -192,8 +206,8 @@ \fp_gset:Nn \g__endiagram_x_max_fp { \int_to_arabic:n { \g__endiagram_points_max_int } } \fp_gsub:Nn \g__endiagram_x_max_fp { 1 } - \exp_args:NNo \fp_gmul:Nn \g__endiagram_x_max_fp - { \l__endiagram_points_step_tl } + \exp_args:NNo \fp_gset:Nn \g__endiagram_x_max_fp + { \g__endiagram_x_max_fp * \l__endiagram_points_step_tl } } \Endiagram_new_environment_command:Nnn \ENcurve { o m } @@ -492,29 +506,27 @@ { \l__endiagram_energy_unit_bool && \l__endiagram_calculate_bool } { \fp_set:Nn \l__Endiagram_tmpb_fp - { (\l__Endiagram_tmpb_fp - \l__Endiagram_tmpa_fp) * \l__endiagram_energy_step_tl } - \bool_if:NTF \l__endiagram_energy_round_places_bool { - \fp_round_places:Nn \l__Endiagram_tmpb_fp - { \l__endiagram_energy_round_tl } + (\l__Endiagram_tmpb_fp - \l__Endiagram_tmpa_fp) * + \l__endiagram_energy_step_tl } + \fp_set:Nn \l__Endiagram_tmpb_fp + { round( \l__Endiagram_tmpb_fp , \l__endiagram_energy_round_tl ) } + \tl_set:Nx \l__endiagram_gain_value_tl { - \fp_round_figures:Nn \l__Endiagram_tmpb_fp - { \l__endiagram_energy_round_tl } - } - \tl_set:Nn \l__endiagram_gain_value_tl - { - = \exp_args:Noo \SI + = \exp_not:N \SI { \fp_to_tl:N \l__Endiagram_tmpb_fp } - { \l__endiagram_energy_unit_tl } + { \exp_not:V \l__endiagram_energy_unit_tl } } + % \tl_show:N \l__endiagram_gain_value_tl } { \fp_compare:nNnTF { \l__Endiagram_tmpa_fp } > { \l__Endiagram_tmpb_fp } { \tl_set:Nn \l__endiagram_gain_value_tl { < 0 } } { \tl_set:Nn \l__endiagram_gain_value_tl { > 0 } } } - \tl_set:Nn \l__endiagram_gain_label_text_tl { $\Delta H \l__endiagram_gain_value_tl$ } + \tl_set:Nn \l__endiagram_gain_label_text_tl + { $\Delta H \l__endiagram_gain_value_tl$ } } \endiagram_draw:nx {} { @@ -693,20 +705,13 @@ \l__Endiagram_tmpb_fp * \l__endiagram_energy_step_tl } - \bool_if:NTF \l__endiagram_energy_round_places_bool - { - \fp_round_places:Nn \l__Endiagram_tmpa_fp - { \l__endiagram_energy_round_tl } - } - { - \fp_round_figures:Nn \l__Endiagram_tmpa_fp - { \l__endiagram_energy_round_tl } - } - \tl_set:Nn \l__endiagram_ea_value_tl + \fp_set:Nn \l__Endiagram_tmpb_fp + { round( \l__Endiagram_tmpb_fp , \l__endiagram_energy_round_tl ) } + \tl_set:Nx \l__endiagram_ea_value_tl { - ~ = ~ \exp_args:Noo \SI + ~ = ~ \exp_not:N \SI { \fp_to_tl:N \l__Endiagram_tmpa_fp } - { \l__endiagram_energy_unit_tl } + { \exp_not:V \l__endiagram_energy_unit_tl } } } \endiagram_draw:xn @@ -780,7 +785,10 @@ \endiagram_draw:xn { \exp_not:V \l__endiagram_ea_tikz_tl } { - ( \fp_to_tl:N \l__endiagram_ea_connect_end_fp , \fp_to_tl:N \l__Endiagram_tmpa_fp ) + ( + \fp_to_tl:N \l__endiagram_ea_connect_end_fp , + \fp_to_tl:N \l__Endiagram_tmpa_fp + ) node ( ea-end @@ -789,7 +797,10 @@ \int_to_arabic:n { \l__endiagram_ea_count_int } ) { } -- - ( \fp_to_tl:N \l__endiagram_ea_connect_end_fp , \fp_to_tl:N \l__Endiagram_tmpb_fp ) + ( + \fp_to_tl:N \l__endiagram_ea_connect_end_fp , + \fp_to_tl:N \l__Endiagram_tmpb_fp + ) } \bool_if:NT \l__endiagram_ea_label_bool { @@ -800,16 +811,16 @@ !\l__endiagram_ea_own_label_bool } { - \fp_set:Nn \l__Endiagram_tmpb_fp + \fp_set:Nn \l__Endiagram_tmpc_fp { ( \l__Endiagram_tmpb_fp - \l__Endiagram_tmpa_fp ) * \l__endiagram_energy_step_tl } - \tl_set:Nn \l__endiagram_ea_value_tl + \tl_gset:Nx \l__endiagram_ea_value_tl { - ~ = ~ \exp_args:Noo \SI - { \fp_to_tl:N \l__Endiagram_tmpb_fp } - { \l__endiagram_energy_unit_tl } + ~ = ~ \exp_not:N \SI + { \fp_to_tl:N \l__Endiagram_tmpc_fp } + { \exp_not:V \l__endiagram_energy_unit_tl } } } \endiagram_draw:xn @@ -817,9 +828,15 @@ { node[\l__endiagram_ea_label_side_tl] at ($ - ( \fp_to_tl:N \l__endiagram_ea_connect_end_fp , \fp_to_tl:N \l__Endiagram_tmpa_fp ) + ( + \fp_to_tl:N \l__endiagram_ea_connect_end_fp , + \fp_to_tl:N \l__Endiagram_tmpa_fp + ) !\l__endiagram_ea_label_pos_tl! - ( \fp_to_tl:N \l__endiagram_ea_connect_end_fp , \fp_to_tl:N \l__Endiagram_tmpb_fp ) + ( + \fp_to_tl:N \l__endiagram_ea_connect_end_fp , + \fp_to_tl:N \l__Endiagram_tmpb_fp + ) $) { \l__endiagram_ea_label_text_tl \l__endiagram_ea_value_tl } } @@ -827,7 +844,10 @@ \endiagram_draw:xn { \exp_not:V \l__endiagram_ea_connect_tikz_tl } { - ( \fp_to_tl:N \l__endiagram_ea_connect_end_fp , \fp_to_tl:N \l__Endiagram_tmpa_fp ) + ( + \fp_to_tl:N \l__endiagram_ea_connect_end_fp , + \fp_to_tl:N \l__Endiagram_tmpa_fp + ) -- ++ ( @@ -952,15 +972,17 @@ \l__Endiagram_tmpb_fp * \l__endiagram_energy_step_tl - \l__endiagram_energy_zero_tl } - \bool_if:NTF \l__endiagram_energy_round_places_bool - { - \fp_round_places:Nn \l__Endiagram_tmpb_fp - { \l__endiagram_energy_round_tl } - } - { - \fp_round_figures:Nn \l__Endiagram_tmpb_fp - { \l__endiagram_energy_round_tl } - } + % \bool_if:NTF \l__endiagram_energy_round_places_bool + % { + \fp_set:Nn \l__Endiagram_tmpb_fp + { round( \l__Endiagram_tmpb_fp , \l__endiagram_energy_round_tl ) } + % \fp_round_places:Nn \l__Endiagram_tmpb_fp + % { \l__endiagram_energy_round_tl } + % } + % { + % \fp_round_figures:Nn \l__Endiagram_tmpb_fp + % { \l__endiagram_energy_round_tl } + % } \tl_set:Nn \l__Endiagram_tmpb_tl { \fp_to_tl:N \l__Endiagram_tmpb_fp } } \endiagram_draw:nx { } @@ -1306,7 +1328,7 @@ \bool_new:N \l__endiagram_axes_add_ticks_bool \bool_new:N \l__endiagram_energy_bool \bool_new:N \l__endiagram_energy_unit_bool -\bool_new:N \l__endiagram_energy_round_places_bool +% \bool_new:N \l__endiagram_energy_round_places_bool \bool_new:N \l__endiagram_calculate_bool \bool_set_true:N \l__endiagram_calculate_bool @@ -1465,8 +1487,8 @@ \tl_set:Nn \l__endiagram_energy_unit_tl { #1 } \bool_set_true:N \l__endiagram_energy_unit_bool , energy-unit-separator .tl_set:N = \l__endiagram_energy_unit_separator_tl , - energy-round-places .bool_set:N = \l__endiagram_energy_round_places_bool , - energy-round-places .default:n = true , + % energy-round-places .bool_set:N = \l__endiagram_energy_round_places_bool , + % energy-round-places .default:n = true , energy-round .tl_set:N = \l__endiagram_energy_round_tl , calculate .bool_set:N = \l__endiagram_calculate_bool , calculate .default:n = true , @@ -1502,15 +1524,16 @@ % linke y-Achse \bool_if:NT \l__endiagram_energy_unit_bool { - \tl_put_right:Nn \l__endiagram_y_label_text_tl + \tl_put_right:Nx \l__endiagram_y_label_text_tl { - \tl_use:N \l__endiagram_energy_unit_separator_tl - \exp_args:No \si { \l__endiagram_energy_unit_tl } + \exp_not:V \l__endiagram_energy_unit_separator_tl + \exp_not:N \si { \exp_not:V \l__endiagram_energy_unit_tl } } } \bool_if:nT { \l__endiagram_y_axis_left_bool || \l__endiagram_axes_all_bool } { - \bool_if:NF \l__endiagram_y_label_pos_bool { \tl_clear:N \l__endiagram_y_label_pos_tl } + \bool_if:NF \l__endiagram_y_label_pos_bool + { \tl_clear:N \l__endiagram_y_label_pos_tl } \endiagram_draw:xx { -> , \exp_not:V \l__endiagram_y_axis_tikz_tl } { @@ -1650,9 +1673,10 @@ Version history internal commands protected where appropriate - various internal changes, most importantly care of not expanding user input that is not supposed to +2014/06/28 v0.1d - adapt to deprecated expl3 function %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO - the whole code should be cleaned up... an embarrising mess! - \ENcurve und \AddAxisLabel so anpassen, dass Eingaben der Energieskala folgen?! -- revise the whole code especially with respect to fp calculations
\ No newline at end of file +- revise the whole code especially with respect to fp calculations |