diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/ocgx2/ChangeLog | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/ocgx2/README | 16 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty | 58 |
3 files changed, 61 insertions, 23 deletions
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=<ocg options> 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=...]{<layer IDs to toggle, space separated>}{<link text>} \showocgs[triggerocg=...]{<layer IDs to switch ON, space separated>}{<link text>} 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={ |