summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/media9/media9.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-01-21 23:54:28 +0000
committerKarl Berry <karl@freefriends.org>2013-01-21 23:54:28 +0000
commitc26285593c8219973e14f6f459c273763ad28121 (patch)
tree42730ad168fc33c1679eb77a23429c0e790ad204 /Master/texmf-dist/tex/latex/media9/media9.sty
parenta53eede45dd9d2659ea0f65cef2686f48e22f07c (diff)
media9 0.20 (21jan13)
git-svn-id: svn://tug.org/texlive/trunk@28897 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/media9/media9.sty')
-rw-r--r--Master/texmf-dist/tex/latex/media9/media9.sty83
1 files changed, 62 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty
index d2d18f54d2f..e76a04b9477 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{2013/01/07}
-\def\g@mix@version@tl{0.19}
+\def\g@mix@date@tl{2013/01/21}
+\def\g@mix@version@tl{0.20}
\def\g@mix@liiikerneldate{2012/07/16}
\def\g@mix@liiipkgdate{2012/07/16}
@@ -278,6 +278,23 @@
}
}
+%creating global definitions
+\cs_new:Npn\mix@newkey#1#2{\tl_gset:cx{#1}{#2}}
+
+%macro for writing global defs to \jobname.aux
+\msg_set:nnn{media9}{rerun}{Rerun~to~get~media~labels~right!}
+\cs_gset:Nn\mix_keytoaux:nn{
+ \iow_now:Nx\@auxout{\token_to_str:N\mix@newkey{#1}{#2}}
+ \bool_if:nF{
+ \cs_if_exist_p:c{#1} && \str_if_eq_x_p:nn{\tl_use:c{#1}}{#2}
+ }{
+ \cs_if_exist:NF\g_mix_rerunwarned_tl{
+ \tl_new:N\g_mix_rerunwarned_tl
+ \AtEndDocument{\msg_warning:nn{media9}{rerun}}
+ }
+ }
+}
+
%reset various variables for every new media inclusion
\cs_new:Nn\mix_reset:{
\tl_gset:Nx\g_mix_label_tl{rm@\int_use:N\g_mix_rmcnt_int}
@@ -397,6 +414,10 @@
\tl_gset:Nx\g_mix_pdflastann_tl{\int_use:c{pdflastannot}~0~R}
}
+ \cs_new:Nn\mix_pdflink:nn{% #1:dict, #2:text
+ \immediate\pdfstartlink~user~{#1}#2\pdfendlink
+ }
+
\cs_new:Nn\mix_pdfxform:n{%#1:savebox number
\immediate\pdfxform~resources~{\the\pdfpageresources}~#1
\tl_gset:Nx\g_mix_pdflastxform_tl{\int_use:c{pdflastxform}~0~R}
@@ -466,6 +487,10 @@
\int_gincr:N\g_mix_obj_int
}
+ \cs_new:Nn\mix_pdflink:nn{% #1:dict, #2:text
+ \special{pdf:bann~<<#1>>}#2\special{pdf:eann}
+ }
+
\cs_new:Nn\mix_pdfxform:n{%#1:savebox number
\special{pdf:bxobj~@mix@obj\int_use:N\g_mix_obj_int\space
width\space\dim_eval:n{\box_wd:N #1}\space
@@ -504,20 +529,21 @@
\bool_new:N\g_mix_powerdot_bool %to cope with some powerdot oddity
\@ifclassloaded{powerdot}{\bool_gset_true:N\g_mix_powerdot_bool}{}
- %define `?pdfmark' operator as in file hdvips.def from package `hyperref'
- \AtBeginDvi{
- \cs_if_exist:NF\pdfmark{
- \special{!~
- systemdict~/pdfmark~known
- {
- userdict~/?pdfmark~systemdict~/exec~get~put
- }{
- userdict~/?pdfmark~systemdict~/pop~get~put~
- userdict~/pdfmark~systemdict~/cleartomark~get~put
- }
- ifelse~
+ \@ifpackageloaded{hyperref}{}{
+ %define `?pdfmark' operator as in file hdvips.def from package `hyperref'
+ \special{!~
+ systemdict~/pdfmark~known
+ {
+ userdict~/?pdfmark~systemdict~/exec~get~put
+ }{
+ userdict~/?pdfmark~systemdict~/pop~get~put~
+ userdict~/pdfmark~systemdict~/cleartomark~get~put
}
+ ifelse~
}
+ }
+
+ \AtBeginDvi{
\bool_if:NT\g_mix_pkgbigfiles_bool{
\special{!~1~dict~begin~(./\jobname.m9)~run~end}
%open auxiliary file \jobname.m9 for writing hex encoded streams
@@ -641,6 +667,20 @@
\int_gincr:N\g_mix_obj_int
}
+ \cs_new:Nn\mix_pdflink:nn{% #1:dict, #2:text
+ \cs_if_exist:NTF\pdfmark{
+ \pdfmark[#2]{pdfmark=/ANN,Raw={#1}}
+ }{
+ \hbox_set:Nn\l_tmpb_box{#2}
+ \mix_pdfannot:nnnn{
+ \box_wd:N\l_tmpb_box}{
+ \box_ht:N\l_tmpb_box}{
+ \box_dp:N\l_tmpb_box
+ }{#1}
+ \box_use_clear:N\l_tmpb_box
+ }
+ }
+
\cs_new:Nn\mix_pdfxform:n{%#1:savebox number
%mark bbox of box#1
\hbox_set:Nn\l_tmpa_box{
@@ -1114,6 +1154,9 @@
>>
}
}
+ \tl_if_empty:NF\g_mix_usrlabel_tl{
+ \mix_keytoaux:nn{main@\g_mix_usrlabel_tl}{\g_mix_pdflastobj_tl}
+ }
\mix_pdfobj:nnn{}{dict}{
/Subtype/\g_mix_mainassetsub_tl
/Instances~[\g_mix_pdflastobj_tl]
@@ -1195,6 +1238,7 @@
/RichMediaContent~\l_mix_content_tl
}
\tl_if_empty:NF\g_mix_usrlabel_tl{
+ \mix_keytoaux:nn{ann@\g_mix_usrlabel_tl}{\g_mix_pdflastann_tl}
\mix_pdfobj:nnn{}{dict}{
/S/JavaScript/JS~(
if(typeof(annotRM)=='undefined'){annotRM=new~Array();}
@@ -1381,9 +1425,9 @@
\cs_new:Npn\mix_parse_windowedarg:w#1x#2\q_stop{
\str_if_eq:nnTF{#1}{default}{
\tl_gset:Nx\tl_mix_fltwd{
- \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_wd_tl}}}
+ \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_wd_tl}}}
\tl_gset:Nx\tl_mix_fltht{
- \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_tt_tl}}}
+ \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_tt_tl}}}
}{
\tl_gset:Nn\tl_mix_fltwd{#1}
\tl_gset:Nn\tl_mix_fltht{#2}
@@ -1402,11 +1446,8 @@
\msg_set:nnn{media9}{same~label}{
Line~\msg_line_number: :~Label~`#1'~multiply~defined.
}
-\msg_set:nnn{media9}{multiple~labels}{\\
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\\
- @@~There~were~multiply-defined~labels!~@@\\
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-}
+
+\msg_set:nnn{media9}{multiple~labels}{ There~were~multiply-defined~labels!}
\bool_new:N\g_mix_usrdraft_bool
\bool_new:N\g_mix_opt_iiidview_bool