diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-09 22:53:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-09 22:53:18 +0000 |
commit | f60df969137ae2a2787ee53c1a313e7eb6b46ea1 (patch) | |
tree | 2680685801ffed8aec0f955c8f06f4ad43bc8b56 /Master/texmf-dist/tex/latex/media9 | |
parent | cdaf9391292e1cbd27960a683f9cb8cf4e9ad729 (diff) |
media9 (9sep12)
git-svn-id: svn://tug.org/texlive/trunk@27631 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/media9')
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/media9.sty | 126 |
1 files changed, 48 insertions, 78 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty index 8c6096b6285..3bb5afa0dee 100644 --- a/Master/texmf-dist/tex/latex/media9/media9.sty +++ b/Master/texmf-dist/tex/latex/media9/media9.sty @@ -39,8 +39,8 @@ \RequirePackage{l3keys2e} \RequirePackage{ifpdf} -\def\g@mix@date@tl{2012/08/14} -\def\g@mix@version@tl{0.11} +\def\g@mix@date@tl{2012/09/07} +\def\g@mix@version@tl{0.12} \def\g@mix@liiikerneldate{2012/07/16} \def\g@mix@liiipkgdate{2012/07/16} @@ -303,6 +303,7 @@ \tl_gset_eq:NN\g_mix_opt_bg_tl\g_mix_pkgopt_bg_tl \tl_gset_eq:NN\g_mix_opt_ls_tl\g_mix_pkgopt_ls_tl \tl_gset_eq:NN\g_mix_opt_rm_tl\g_mix_pkgopt_rm_tl + \tl_gset:Nn\g_mix_opt_psob_tl{Min} \tl_gset:Nn\g_mix_opt_coo_tl{0~0~0} \tl_gset:Nn\g_mix_opt_ctoc_tl{0~-1~0} \tl_gset:Nn\g_mix_opt_ciiw_tl{} @@ -324,6 +325,7 @@ \tl_set:Nn\l_mix_bg_tl{} \tl_set:Nn\l_mix_ls_tl{} \tl_set:Nn\l_mix_rm_tl{} + \tl_set:Nn\l_mix_psob_tl{Min} \tl_set:Nn\l_mix_coo_tl{0~0~0} \tl_set:Nn\l_mix_ctoc_tl{0~-1~0} \tl_set:Nn\l_mix_ciiw_tl{} @@ -510,7 +512,7 @@ \iow_new:N\g_mix_mstreams_stream \iow_open:Nn\g_mix_mstreams_stream{\jobname.m9} \iow_now:Nn\g_mix_mstreams_stream{ - 1~dict~begin~ + 1~dict~begin /o{mark/_objdef}bind~def/O{/type/stream/OBJ~pdfmark}bind~def /m~systemdict/mark~get~def /P{/ASCIIHexDecode~filter/PUT~pdfmark}bind~def @@ -518,9 +520,9 @@ } } } + \bool_if:NT\g_mix_pkgbigfiles_bool{ - \RequirePackage{atenddvi} - \AtEndDvi{ + \AtEndDocument{ \iow_now:Nn\g_mix_mstreams_stream{end} \iow_close:N\g_mix_mstreams_stream } @@ -969,7 +971,7 @@ \NewDocumentCommand\addmediapath{m}{\file_path_include:n{#1/}} -\NewDocumentCommand\includemedia{omm}{%#1 options, #2 text/image #3 media file +\NewDocumentCommand\includemedia{O{}mm}{%#1 options, #2 text/image #3 media file \group_begin: \leavevmode \mix_reset: @@ -1059,6 +1061,7 @@ \tl_set_eq:NN\l_mix_bg_tl\g_mix_opt_bg_tl \tl_set_eq:NN\l_mix_ls_tl\g_mix_opt_ls_tl \tl_set_eq:NN\l_mix_rm_tl\g_mix_opt_rm_tl + \tl_set_eq:NN\l_mix_psob_tl\g_mix_opt_psob_tl \tl_set_eq:NN\l_mix_coo_tl\g_mix_opt_coo_tl \tl_set_eq:NN\l_mix_ctoc_tl\g_mix_opt_ctoc_tl \tl_set_eq:NN\l_mix_ciiw_tl\g_mix_opt_ciiw_tl @@ -1204,34 +1207,6 @@ \group_end: \cs_set_eq:NN\mix_uriend:\group_end: -% macro to format a real number in tl variable -% * to show at most 9 places after `.' -% * trailing zeros removed -\cs_new_protected:Nn\mix_format_num:N{ - \fp_compare:nNnF{#1}={\fp_to_int:n{#1}}{ - \tl_set:Nx#1{\exp_after:wN\mix_format_num:w#1\q_stop} - } -} -\cs_new:Npn\mix_format_num:w#1.#2\q_stop{ - #1.\exp_after:wN\mix_trim_places:w#2000000000\q_stop -} -\cs_new:Npn\mix_trim_places:w#1#2#3#4#5#6#7#8#9\q_stop{ - \mix_trim_zeros:f{\exp_after:wN\tl_head:w#9\q_stop#8#7#6#5#4#3#2#1} -} -\cs_new:Nn\mix_trim_zeros:n{ - \exp_after:wN\mix_trim_zeros:w#1\q_stop -} -\cs_generate_variant:Nn\mix_trim_zeros:n{f} -\cs_new:Npn\mix_trim_zeros:w#1#2\q_stop{ - \str_if_eq:nnTF{#1}{0}{ - \int_compare:nNnTF{\tl_length:n{#2}}>{\c_one}{ - \exp_after:wN\mix_trim_zeros:w#2\q_stop - }{#2} - }{ - \tl_reverse:n{#2}#1 - } -} - %macro for building the C2W transformation matrix \cs_new:Npn\mix_calc_ciiw:w#1~#2~#3~#4~#5~#6\q_stop{ % #1,#2,#3 centre of orbit coordinates (coo) @@ -1316,30 +1291,18 @@ \fp_set:Nn\l_mix_transz_fp{#3 - \l_mix_roo_fp*\l_mix_viewz_fp} %format elements of transformation matrix - \tl_set:Nx\l_mix_leftx_tl {\fp_use:N\l_mix_leftx_fp } - \tl_set:Nx\l_mix_lefty_tl {\fp_use:N\l_mix_lefty_fp } - \tl_set:Nx\l_mix_leftz_tl {\fp_use:N\l_mix_leftz_fp } - \tl_set:Nx\l_mix_upx_tl {\fp_use:N\l_mix_upx_fp } - \tl_set:Nx\l_mix_upy_tl {\fp_use:N\l_mix_upy_fp } - \tl_set:Nx\l_mix_upz_tl {\fp_use:N\l_mix_upz_fp } - \tl_set:Nx\l_mix_viewx_tl {\fp_use:N\l_mix_viewx_fp } - \tl_set:Nx\l_mix_viewy_tl {\fp_use:N\l_mix_viewy_fp } - \tl_set:Nx\l_mix_viewz_tl {\fp_use:N\l_mix_viewz_fp } - \tl_set:Nx\l_mix_transx_tl{\fp_use:N\l_mix_transx_fp} - \tl_set:Nx\l_mix_transy_tl{\fp_use:N\l_mix_transy_fp} - \tl_set:Nx\l_mix_transz_tl{\fp_use:N\l_mix_transz_fp} - \mix_format_num:N\l_mix_leftx_tl - \mix_format_num:N\l_mix_lefty_tl - \mix_format_num:N\l_mix_leftz_tl - \mix_format_num:N\l_mix_upx_tl - \mix_format_num:N\l_mix_upy_tl - \mix_format_num:N\l_mix_upz_tl - \mix_format_num:N\l_mix_viewx_tl - \mix_format_num:N\l_mix_viewy_tl - \mix_format_num:N\l_mix_viewz_tl - \mix_format_num:N\l_mix_transx_tl - \mix_format_num:N\l_mix_transy_tl - \mix_format_num:N\l_mix_transz_tl + \tl_set:Nx\l_mix_leftx_tl {\fp_to_decimal:n{round((\l_mix_leftx_fp),9)} } + \tl_set:Nx\l_mix_lefty_tl {\fp_to_decimal:n{round((\l_mix_lefty_fp),9)} } + \tl_set:Nx\l_mix_leftz_tl {\fp_to_decimal:n{round((\l_mix_leftz_fp),9)} } + \tl_set:Nx\l_mix_upx_tl {\fp_to_decimal:n{round((\l_mix_upx_fp),9)} } + \tl_set:Nx\l_mix_upy_tl {\fp_to_decimal:n{round((\l_mix_upy_fp),9)} } + \tl_set:Nx\l_mix_upz_tl {\fp_to_decimal:n{round((\l_mix_upz_fp),9)} } + \tl_set:Nx\l_mix_viewx_tl {\fp_to_decimal:n{round((\l_mix_viewx_fp),9)} } + \tl_set:Nx\l_mix_viewy_tl {\fp_to_decimal:n{round((\l_mix_viewy_fp),9)} } + \tl_set:Nx\l_mix_viewz_tl {\fp_to_decimal:n{round((\l_mix_viewz_fp),9)} } + \tl_set:Nx\l_mix_transx_tl{\fp_to_decimal:n{round((\l_mix_transx_fp),9)}} + \tl_set:Nx\l_mix_transy_tl{\fp_to_decimal:n{round((\l_mix_transy_fp),9)}} + \tl_set:Nx\l_mix_transz_tl{\fp_to_decimal:n{round((\l_mix_transz_fp),9)}} %concat elements to matrix \tl_set:Nx\l_mix_ciiw_tl{ @@ -1360,19 +1323,16 @@ % 3D view object \cs_new:Nn\mix_view:n{ - \tl_set:Nx\l_mix_oscale_tl{\fp_use:N\l_mix_oscale_fp} - \mix_format_num:N\l_mix_oscale_tl - \tl_set:Nx\l_mix_aac_tl{\fp_use:N\l_mix_aac_fp} - \mix_format_num:N\l_mix_aac_tl - \tl_set:Nx\l_mix_roo_tl{\fp_use:N\l_mix_roo_fp} - \mix_format_num:N\l_mix_roo_tl + \tl_set:Nx\l_mix_oscale_tl{\fp_to_decimal:n{round((\l_mix_oscale_fp),9)}} + \tl_set:Nx\l_mix_aac_tl{\fp_to_decimal:n{round((\l_mix_aac_fp),9)}} + \tl_set:Nx\l_mix_roo_tl{\fp_to_decimal:n{round((\l_mix_roo_fp),9)}} \mix_pdfobj:nnn{}{dict}{ /MS/M /P<< \bool_if:NTF\l_mix_iiidortho_bool{ - /Subtype/O/OS~\l_mix_oscale_tl/OB/Min + /Subtype/O/OS~\l_mix_oscale_tl/OB/\l_mix_psob_tl }{ - /Subtype/P/FOV~\l_mix_aac_tl/PS/Min + /Subtype/P/FOV~\l_mix_aac_tl/PS/\l_mix_psob_tl } >> /C2W~[\l_mix_ciiw_tl] @@ -1590,6 +1550,11 @@ }, 3Drender .value_required:, + 3Dpsob .code:n = { + \tl_gset:Nx\g_mix_opt_psob_tl{#1} + }, + 3Dpsob .value_required:, + 3Dviews .code:n = { \file_if_exist:nTF{#1}{ \file_add_path:nN{#1}\l_mix_temp_tl @@ -1800,6 +1765,17 @@ }, ORTHO .default:n = {1}, + PSOB .code:n = { + \int_compare:nTF{\l_mix_level_tl=\c_zero}{ + \tl_set:Nx\l_mix_psob_tl{#1} + }{ + \msg_error:nnxxxx{media9}{key~not~allowed} + {\g_mix_vfile_tl}{\int_use:N\l_mix_lineno_int} + {PSOB}{a~VIEW} + } + }, + PSOB .value_required:, + ROLL .code:n = { \int_compare:nF{\l_mix_level_tl=\c_zero}{ \msg_error:nnxxxx{media9}{key~not~allowed} @@ -1919,8 +1895,7 @@ \seq_set_split:Nnn\l_mix_args_seq{~}{#1} \seq_map_inline:Nn\l_mix_args_seq{ \fp_set:Nn\l_mix_tmpa_fp{##1} - \tl_set:Nx\l_mix_tmpa_tl{\fp_use:N\l_mix_tmpa_fp} - \mix_format_num:N\l_mix_tmpa_tl + \tl_set:Nx\l_mix_tmpa_tl{\fp_to_decimal:n{round((\l_mix_tmpa_fp),9)}} \tl_put_right:Nx\l_mix_ndtrans_tl{~\l_mix_tmpa_tl} } }, @@ -1949,12 +1924,9 @@ } \tl_set:Nx\l_mix_args_tl{#1\space} \exp_after:wN\mix_parse_vect:w\l_mix_args_tl\q_stop - \tl_set:Nx\l_mix_x_tl{\fp_use:N\l_mix_x_fp} - \mix_format_num:N\l_mix_x_tl - \tl_set:Nx\l_mix_y_tl{\fp_use:N\l_mix_y_fp} - \mix_format_num:N\l_mix_y_tl - \tl_set:Nx\l_mix_z_tl{\fp_use:N\l_mix_z_fp} - \mix_format_num:N\l_mix_z_tl + \tl_set:Nx\l_mix_x_tl{\fp_to_decimal:n{round((\l_mix_x_fp),9)}} + \tl_set:Nx\l_mix_y_tl{\fp_to_decimal:n{round((\l_mix_y_fp),9)}} + \tl_set:Nx\l_mix_z_tl{\fp_to_decimal:n{round((\l_mix_z_fp),9)}} \tl_set:Nx\l_mix_cscentre_tl{ \l_mix_x_tl\space \l_mix_y_tl\space @@ -1977,10 +1949,8 @@ \fp_set:Nn\l_mix_roty_fp{-\l_mix_roty_fp} %rot angle of normal vec around Z axis \mix_angfromxy:Nnn\l_mix_rotz_fp\l_mix_x_fp\l_mix_y_fp - \tl_set:Nx\l_mix_roty_tl{\fp_use:N\l_mix_roty_fp} - \mix_format_num:N\l_mix_roty_tl - \tl_set:Nx\l_mix_rotz_tl{\fp_use:N\l_mix_rotz_fp} - \mix_format_num:N\l_mix_rotz_tl + \tl_set:Nx\l_mix_roty_tl{\fp_to_decimal:n{round((\l_mix_roty_fp),9)}} + \tl_set:Nx\l_mix_rotz_tl{\fp_to_decimal:n{round((\l_mix_rotz_fp),9)}} \tl_set:Nx\l_mix_csorient_tl{null~\l_mix_roty_tl\space\l_mix_rotz_tl} }, NORMAL .value_required:, |