diff options
author | Karl Berry <karl@freefriends.org> | 2015-12-03 22:46:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-12-03 22:46:48 +0000 |
commit | ee4ab901012be761b70b8cde7784d8c3f901b053 (patch) | |
tree | 46ee6dcdd87bf56fa5a76d2e76b21f6b688be179 /Master/texmf-dist/tex/latex | |
parent | 86cc950723f91a5018990b9fb405dd0dc96803e4 (diff) |
ocgx2 (3dec15)
git-svn-id: svn://tug.org/texlive/trunk@39010 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty index 2bf8d2273ba..8c55dbbf92d 100644 --- a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty +++ b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty @@ -36,9 +36,8 @@ \RequirePackage{xparse} \RequirePackage{l3keys2e} -\RequirePackage{afterpage} -\ProvidesExplPackage{ocgx2}{2015/11/26}{0.12} +\ProvidesExplPackage{ocgx2}{2015/12/03}{0.13} {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} %creating global definitions @@ -121,9 +120,14 @@ } \cs_new_nopar:Nn\ocgxii_beginocg:nnnn{ - \bool_gset_false:N\g_ocgxii_nestedE_bool - \bool_if:NT\g_ocgxii_nestedB_bool{\ocgbase_add_to_order_list:n{[}} + \bool_if:NT\g_ocgxii_nestedB_bool{ + \seq_gput_left:Nx\g_ocgxii_nested_seq{ + \seq_item:Nn\g_ocgxii_ocgstack_seq{\c_one} + } + \ocgbase_add_to_order_list:n{[} + } \bool_gset_true:N\g_ocgxii_nestedB_bool + \bool_gset_false:N\g_ocgxii_nestedE_bool \group_begin: \ocgxii_reset_cmd_opts: % ... to the user-set package options \tl_if_exist:cTF{ocgxii@#3}{ %re-open existing layer @@ -145,8 +149,9 @@ \ocgbase_add_to_off_list:n{\tl_use:c{ocgxii@#3}} } }{ - \tl_gset:cn{ocgxii@#3.opts}{#1} - \keys_set:nn{ocgx2/user}{#1} + \tl_set:Nx\l_tempa_tl{#1} + \tl_gset:cx{ocgxii@#3.opts}{\l_tempa_tl} + \keys_set:nV{ocgx2/user}\l_tempa_tl \ocgbase_new_ocg:nnn{#2}{ \l_ocgxii_view_tl\l_ocgxii_print_tl\l_ocgxii_export_tl }{#4} @@ -188,15 +193,26 @@ \cs_new_nopar:Nn\ocgxii_endocg:{ \unskip \ocgbase_oc_emc: + \bool_if:nT{ + \g_ocgxii_nestedE_bool && + \str_if_eq_x_p:nn{ + \seq_item:Nn\g_ocgxii_nested_seq{\c_one} + }{ + \seq_item:Nn\g_ocgxii_ocgstack_seq{\c_one} + } + }{ + \ocgbase_add_to_order_list:n{]} + \seq_gpop_left:NN\g_ocgxii_nested_seq\l_trash_tl + } \seq_gpop_left:NN\g_ocgxii_ocgstack_seq\l_trash_tl \ocgxii_ocgstack_shipout:N\g_ocgxii_ocgstack_seq \bool_gset_false:N\g_ocgxii_nestedB_bool - \bool_if:NT\g_ocgxii_nestedE_bool{\ocgbase_add_to_order_list:n{]}} \bool_gset_true:N\g_ocgxii_nestedE_bool } \bool_new:N\g_ocgxii_nestedB_bool % nested OCG begin \bool_new:N\g_ocgxii_nestedE_bool % nested OCG end +\seq_new:N\g_ocgxii_nested_seq % for keeping track of parent OCGs \cs_new_nopar:Nn\ocgxii_ocgstack_shipout:N{ \iow_shipout_x:Nx\@mainaux{ @@ -463,7 +479,8 @@ /Subtype/Link\ocgxii@insert@OC /A <</S/SetOCGState /State [ - \str_if_eq:VnF{\l_ocgxii_toswitch_u_tl}{}{/Toggle~\l_ocgxii_toswitch_tl}~ + \str_if_eq:VnF{\l_ocgxii_toswitch_u_tl}{}{ + /Toggle~\l_ocgxii_toswitch_tl}~ \str_if_eq:VnF{\l_ocgxii_toshow_u_tl}{}{/ON~\l_ocgxii_toshow_tl}~ \str_if_eq:VnF{\l_ocgxii_tohide_u_tl}{}{/OFF~\l_ocgxii_tohide_tl} ] @@ -565,7 +582,9 @@ \cs_new:Nn\ocgxii_process_ocgref:NN{ \str_if_eq_x:nnF{#2}{}{ - \tl_if_exist:cTF{ocgx2.ocg.#2}{\tl_put_right:Nx#1{~\tl_use:c{ocgx2.ocg.#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} \tl_if_exist:NF\g_ocgxii_refundefwarned_tl{ \tl_new:N\g_ocgxii_refundefwarned_tl @@ -660,23 +679,30 @@ \usetikzlibrary{calc} % Copyright notice: The code that follows until the end of the file was -% copied from Paul Gaborit's `tikzlibraryocgx.code.tex' without modification +% taken from Paul Gaborit's `tikzlibraryocgx.code.tex' with minor modification. \tikzset{ ocg/.style={ocg/.cd,#1,/tikz/.cd}, ocg={ % parameters - name/.store in=\ocgx@name, - visibity/.store in=\ocgx@visibility, + name/.store in=\ocgxii@name, + opts/.store in=\ocgxii@opts, + visibility/.store in=\ocgxii@visibility, status/.is choice, - status/visible/.style={visibity=1}, - status/invisible/.style={visibity=0}, + status/visible/.style={visibility=1}, + status/invisible/.style={visibility=0}, + status/true/.style={visibility=1}, + status/false/.style={visibility=0}, + status/on/.style={visibility=1}, + status/off/.style={visibility=0}, % default values name=, + opts=, status=visible, % ref ref/.style={ - /tikz/execute at begin scope={\ocg{\ocgx@name}{#1}{\ocgx@visibility}}, - /tikz/execute at end scope={\endocg}, + /tikz/execute at begin scope={% + \begin{ocg}[\ocgxii@opts]{\ocgxii@name}{#1}{\ocgxii@visibility}}, + /tikz/execute at end scope={\end{ocg}}, }, }, switch ocg/.style={ |