From ee4ab901012be761b70b8cde7784d8c3f901b053 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 3 Dec 2015 22:46:48 +0000 Subject: ocgx2 (3dec15) git-svn-id: svn://tug.org/texlive/trunk@39010 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ocgx2/ChangeLog | 10 ++++- Master/texmf-dist/doc/latex/ocgx2/README | 16 +++++--- Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty | 58 +++++++++++++++++++++-------- 3 files changed, 61 insertions(+), 23 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/ocgx2/ChangeLog b/Master/texmf-dist/doc/latex/ocgx2/ChangeLog index 535b67d6375..d2a9fa7b453 100644 --- a/Master/texmf-dist/doc/latex/ocgx2/ChangeLog +++ b/Master/texmf-dist/doc/latex/ocgx2/ChangeLog @@ -1,8 +1,14 @@ +2015-12-03 + * v0.13 : ocgx2.sty + * fix: bug occasionally creating wrong OCG listing in the layers + tab of the pdf viewer in connection with nested OCGs + * new: parameter `opts' added to TikZ style `ocg' + 2015-11-26 * v0.12 : ocgx2.sty * v0.4 : ocgbase.sty - * fix: last argument of `ocg' environment (initial visibility) had no effect - when re-opening an OCG + * fix: last argument of `ocg' environment (initial visibility) + had no effect when re-opening an OCG 2015-11-23 * v0.11 : ocgx2.sty diff --git a/Master/texmf-dist/doc/latex/ocgx2/README b/Master/texmf-dist/doc/latex/ocgx2/README index db056cfdf16..1944aeb126f 100644 --- a/Master/texmf-dist/doc/latex/ocgx2/README +++ b/Master/texmf-dist/doc/latex/ocgx2/README @@ -1,7 +1,7 @@ ================================== The `ocgx2' LaTeX Package - Version 0.12 [2015/11/26] + Version 0.13 [2015/12/03] (C) 2015--\today Alexander Grahn ================================== @@ -14,8 +14,8 @@ The intent of this package is to be a drop-in replacement for the already existing packages `ocgx' by Paul Gaborit and `ocg-p' by Werner Moshammer for the creation of PDF Layers. -It re-implements the functionality of the `ocg', `ocgx' and `ocg-p' packages -and adds support for all known engines and back-ends including: +It re-implements the functionality of the `ocg', `ocgx' and `ocg-p' +packages and adds support for all known engines and back-ends including: * LaTeX --> dvips --> ps2pdf/Distiller * (Xe)LaTeX --> (x)dvipdfmx @@ -47,10 +47,15 @@ instead of \usepackage{tikz} \usetikzlibrary{ocgx} -to enable these TikZ styles and read the `ocgx' documentation about their usage: +to enable these TikZ styles and read the `ocgx' documentation about +their usage: texdoc ocgx +The /tikz/ocg/opts= parameter adds to the list in section +`How to add TikZ scopes into OCGs' in the `ocgx' manual. It allows +passing ocg environment options (see below) to the TikZ scope. + 2. Usage ======== @@ -103,7 +108,8 @@ For details about their usage, read the `ocgx' package manual: texdoc ocgx -For compatibility with the `ocg-p' package, the following commands have been provided: +For compatibility with the `ocg-p' package, the following commands have +been provided: \toggleocgs[triggerocg=...]{}{} \showocgs[triggerocg=...]{}{} 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 <