diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty index 946682d0332..2bf8d2273ba 100644 --- a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty +++ b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty @@ -38,7 +38,7 @@ \RequirePackage{l3keys2e} \RequirePackage{afterpage} -\ProvidesExplPackage{ocgx2}{2015/11/23}{0.11} +\ProvidesExplPackage{ocgx2}{2015/11/26}{0.12} {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} %creating global definitions @@ -135,14 +135,22 @@ }{ \bool_gset_false:N\g_ocgxii_nestedB_bool } + \bool_if:nTF{ %initial visibility + \str_if_eq_p:nn{#4}{\c_one} || + \str_if_eq_p:nn{#4}{on} || + \str_if_eq_p:nn{#4}{true} + }{ + \ocgbase_del_from_off_list:n{\tl_use:c{ocgxii@#3}} + }{ + \ocgbase_add_to_off_list:n{\tl_use:c{ocgxii@#3}} + } }{ \tl_gset:cn{ocgxii@#3.opts}{#1} \keys_set:nn{ocgx2/user}{#1} - \ocgbase_new_ocg:xxx{#2}{ + \ocgbase_new_ocg:nnn{#2}{ \l_ocgxii_view_tl\l_ocgxii_print_tl\l_ocgxii_export_tl }{#4} \tl_gset:cx{ocgxii@#3}{\ocgbase_last_ocg:} - \tl_gset:cn{ocgxii_#3_is_listed}{0} \int_compare:nTF{\l_ocgxii_listno_tl=\c_one}{ \bool_gset_false:N\g_ocgxii_nestedB_bool }{ @@ -153,7 +161,7 @@ } } \seq_map_inline:Nn\l_ocgxii_rbgrps_seq{% process list of radio btn groups - \ocgbase_add_ocg_to_radiobtn_grp:xxx{##1}{\tl_use:c{ocgxii@#3}}{ + \ocgbase_add_ocg_to_radiobtn_grp:nnn{##1}{\tl_use:c{ocgxii@#3}}{ \int_compare:nTF{\l_ocgxii_listno_tl=\c_one}{false}{true} } } @@ -164,7 +172,7 @@ \c_false_bool } }{ - \cs_if_exist:NF\g_ocgxii_rerunwarned_tl{ + \tl_if_exist:NF\g_ocgxii_rerunwarned_tl{ \tl_new:N\g_ocgxii_rerunwarned_tl \AtEndDocument{\msg_warning:nn{ocgx2}{rerun}} } @@ -190,7 +198,7 @@ \bool_new:N\g_ocgxii_nestedB_bool % nested OCG begin \bool_new:N\g_ocgxii_nestedE_bool % nested OCG end -\cs_gset:Nn\ocgxii_ocgstack_shipout:N{ +\cs_new_nopar:Nn\ocgxii_ocgstack_shipout:N{ \iow_shipout_x:Nx\@mainaux{ \token_to_str:N\ocgxii@stack@on@page{ \exp_not:N\int_use:N\g_ocgxii_page_int @@ -212,7 +220,7 @@ %end of page action in output routine \cs_new_nopar:Nn\ocgxii_at_end_page:{ %check whether end-of-page ocg stack has settled - \iow_now:Nx\@mainaux{ + \iow_shipout:Nx\@mainaux{ \token_to_str:N\ocgxii@newkey{ocgx2.oldstack.\int_use:N\g_ocgxii_page_int}{ \seq_use:cn{g_pending_ocgs_on_\int_use:c{g_ocgxii_page_int}_seq}{,} } @@ -228,7 +236,7 @@ \c_false_bool } }{ - \cs_if_exist:NF\g_ocgxii_rerunwarned_tl{ + \tl_if_exist:NF\g_ocgxii_rerunwarned_tl{ \tl_new:N\g_ocgxii_rerunwarned_tl \AtEndDocument{\msg_warning:nn{ocgx2}{rerun}} } @@ -251,9 +259,9 @@ \seq_map_variable:NNn\l_ocgxii_temp_seq\l_ocgxii_arg_tl{ \ocgbase_oc_bdc:n{\l_ocgxii_arg_tl} } - % copy pending ocg stack to next page, if it has not been initialized yet - % from aux file \int_gincr:N\g_ocgxii_page_int + % copy pending ocg stack from previous page, if it has not been initialized + % yet from aux file \seq_if_exist:cF{g_pending_ocgs_on_\int_use:c{g_ocgxii_page_int}_seq}{ \seq_gset_eq:cc{ g_pending_ocgs_on_\int_use:c{g_ocgxii_page_int}_seq @@ -280,20 +288,20 @@ %macro that inserts /OC <<OCMD with currently open OCGs>> entry; %for use within annotation dicts -\tl_set:Nn\ocgxii@insert@OC{ +\cs_new_nopar:Npn\ocgxii@insert@OC{ \seq_if_empty:NF\g_ocgxii_ocgstack_seq{ /OC~<</Type/OCMD/OCGs~[\seq_use:Nn\g_ocgxii_ocgstack_seq{~}]/P/AllOn>> } } -\cs_set:Nn\ocgxii_ocglist_reset:{ +\cs_new_nopar:Nn\ocgxii_ocglist_reset:{ \tl_clear_new:N\l_ocgxii_u_list_tl \tl_clear_new:N\l_ocgxii_d_list_tl \tl_clear_new:N\l_ocgxii_e_list_tl \tl_clear_new:N\l_ocgxii_x_list_tl } -\cs_set:Nn\ocgxii_ocglist_build:Nn{ +\cs_new_nopar:Nn\ocgxii_ocglist_build:Nn{ \tl_set:Nx\l_ocglistarg_tl{#2}\tl_trim_spaces:N\l_ocglistarg_tl \seq_set_split:NnV\l_ocgxii_ocglistarg_seq{~}\l_ocglistarg_tl \seq_map_variable:NNn\l_ocgxii_ocglistarg_seq\l_tempa_tl{ @@ -309,7 +317,7 @@ \ocgxii_ocglist_build:Nn\l_ocgxii_u_list_tl{\seq_item:Nn\l_tmpa_seq{4}} } -\cs_set:Nn\ocgxii_ocglist_process_idlist:nn{ +\cs_new_nopar:Nn\ocgxii_ocglist_process_idlist:nn{ \ocgxii_ocglist_reset: \tl_set:Nx\l_ocgxii_opt_tl{#1}\tl_remove_all:Nn\l_ocgxii_opt_tl{~} \str_case_x:nnF{\l_ocgxii_opt_tl}{ @@ -335,7 +343,8 @@ \int_new:N\g_ocgxii_widcount_int% widget counter -%re-implement commands from ocg-p.sty / ocgx.sty (all engines including ps2pdf [gs>=9.15]) +%re-implement commands from ocg-p.sty / ocgx.sty (all engines including +%ps2pdf [gs>=9.15]) \DeclareDocumentCommand\switchocg{o m +m}{ \leavevmode \IfNoValueTF{#1}{ @@ -558,7 +567,7 @@ \str_if_eq_x:nnF{#2}{}{ \tl_if_exist:cTF{ocgx2.ocg.#2}{\tl_put_right:Nx#1{~\tl_use:c{ocgx2.ocg.#2}}}{ \msg_warning:nnx{ocgx2}{undefined~OCG}{#2} - \cs_if_exist:NF\g_ocgxii_refundefwarned_tl{ + \tl_if_exist:NF\g_ocgxii_refundefwarned_tl{ \tl_new:N\g_ocgxii_refundefwarned_tl \AtEndDocument{\msg_warning:nn{ocgx2}{undefined~OCGs}} } @@ -627,7 +636,7 @@ } % dvipdfmx and xelatex workaround for ocg buttons within `tikzpicture' context -\cs_set:Nn\ocgxii_pdflink:nn{ +\cs_new:Nn\ocgxii_pdflink:nn{ \bool_if:nTF{ \g_ocgxii_dvipdfmx_bool && \cs_if_exist_p:N\pgfpictureid }{ |