diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty index df92035991e..445d42a2752 100644 --- a/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty +++ b/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty @@ -94,8 +94,8 @@ \RequirePackage{l3keys2e} \RequirePackage{atenddvi} -\def\g@ocgbase@date@tl{2015/11/02} -\def\g@ocgbase@version@tl{0.2} +\def\g@ocgbase@date@tl{2015/11/23} +\def\g@ocgbase@version@tl{0.3} \ProvidesExplPackage{ocgbase}{\g@ocgbase@date@tl}{\g@ocgbase@version@tl} {support package for ocgx2.sty} @@ -115,7 +115,6 @@ %process package options \ProcessKeysOptions{ocgbase} -%\AtBeginDocument{ \AtBeginDvi{ \@ifpackageloaded{pdfbase}{}{\RequirePackage{pdfbase}} } @@ -135,7 +134,7 @@ \pbs_pdfobj:nnn{}{array}{\g_ocgbase_offocgs_tl} \tl_set:Nx\l_ocgbase_offocgentry_tl{/OFF~\pbs_pdflastobj:} } - %build Order list + %global Order list \tl_new:N\l_ocgbase_ocgorderentry_tl \seq_if_empty:NF\g_ocgbase_ocgorder_seq{ %process radio button groups in the Order array @@ -156,7 +155,11 @@ } %second sweep on Order array to generate the final Order entry \tl_new:N\l_ocgbase_ocgorder_tl + \tl_set:Nn\l_ocgbase_order_item_count_tl{\c_zero} \seq_map_inline:Nn\g_ocgbase_ocgorder_seq{ + \tl_set:Nx\l_ocgbase_order_item_count_tl{ + \int_eval:n{\l_ocgbase_order_item_count_tl+\c_one} + } \cs_if_exist:cTF{g_ocgbase_#1_rbtn_order_seq}{ \int_compare:nT{\seq_count:c{g_ocgbase_#1_rbtn_order_seq}>\c_zero}{ \tl_put_right:Nx\l_ocgbase_ocgorder_tl{ @@ -164,8 +167,25 @@ } } }{ - %ordinary (non-radiobutton group) item (ocg obj ref, `[', `]') - \tl_put_right:Nn\l_ocgbase_ocgorder_tl{~#1} + %ordinary (non-radiobutton group) item (ocg obj ref, `[' or `]'), + \tl_set:Nx\l_ocgbase_current_order_item_tl{#1} + \tl_set:Nx\l_ocgbase_next_order_item_tl{ + \seq_item:Nn\g_ocgbase_ocgorder_seq{ + \l_ocgbase_order_item_count_tl+\c_one + } + } + \tl_set:Nx\l_ocgbase_prev_order_item_tl{ + \seq_item:Nn\g_ocgbase_ocgorder_seq{ + \l_ocgbase_order_item_count_tl-\c_one + } + } + \bool_if:nF{ %avoid empty nesting groups + \str_if_eq_p:Vn\l_ocgbase_current_order_item_tl{[} && + \str_if_eq_p:Vn\l_ocgbase_next_order_item_tl{]} + || + \str_if_eq_p:Vn\l_ocgbase_current_order_item_tl{]} && + \str_if_eq_p:Vn\l_ocgbase_prev_order_item_tl{[} + }{\tl_put_right:Nn\l_ocgbase_ocgorder_tl{~#1}} } } \tl_if_empty:NF\l_ocgbase_ocgorder_tl{ @@ -229,7 +249,7 @@ \cs_new:Nn\ocgbase_last_ocg:{\g_ocgbase_last_ocg_tl} %macro for appending OCG object to global `Order' list -% in Layers Tab of the GUI) +% in Layers Tab of the GUI \cs_new:Nn\ocgbase_add_to_order_list:n{ \seq_gput_right:Nx\g_ocgbase_ocgorder_seq{#1} } |