From 200dac99798d6f21c19080f7af67db478064fcb6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 25 Sep 2018 20:26:19 +0000 Subject: ocgx2 (25sep18) git-svn-id: svn://tug.org/texlive/trunk@48759 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty | 211 +++++++++++++++++++++------- 1 file changed, 161 insertions(+), 50 deletions(-) (limited to 'Master/texmf-dist/tex/latex/ocgx2') diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty index b3a287b3514..77ec3292ffe 100644 --- a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty +++ b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty @@ -20,6 +20,9 @@ % themselves placed on layers, compatibility with the animate and media9 % packages. % +% Re-implements hyperref's `ocgcolorlinks' option to produce coloured links +% that may wrap around line breaks and page breaks. +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This work may be distributed and/or modified under the @@ -35,8 +38,8 @@ \RequirePackage{xparse} \RequirePackage{l3keys2e} -\def\g@ocgxii@date@tl{2018/06/27} -\def\g@ocgxii@version@tl{0.36} +\def\g@ocgxii@date@tl{2018/09/25} +\def\g@ocgxii@version@tl{0.37} \ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl} {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} @@ -379,19 +382,19 @@ \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}{ - {triggerocg=onmouseup}{ + {onmouseup}{ \ocgxii_ocglist_build:Nn\l_ocgxii_u_list_tl{#2} } - {triggerocg=onmousedown}{ + {onmousedown}{ \ocgxii_ocglist_build:Nn\l_ocgxii_d_list_tl{#2} } - {triggerocg=onmouseenter}{ + {onmouseenter}{ \ocgxii_ocglist_build:Nn\l_ocgxii_e_list_tl{#2} } - {triggerocg=onmouseexit}{ + {onmouseexit}{ \ocgxii_ocglist_build:Nn\l_ocgxii_x_list_tl{#2} } - {triggerocg=allactions}{ + {onmouseall}{ \ocgxii_commalist_process:n{#2} } }{ @@ -403,7 +406,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % re-implement commands from ocgx.sty (all engines including ps2pdf [gs>=9.15]) -% adding optional `*` (arg 1) -> non-breakable link instead of plain (multiline) +% adding optional `*' (arg 1) -> non-breakable link instead of plain (multiline) % Link; % adding optional 2nd argument -> Button Widget (non-breakable) with one of % various mouse triggers (`troggerocgs` option from ocg-p) @@ -446,21 +449,21 @@ % %process *all* mouse triggers (e,d,u,x) \ocgxii_ocglist_process_idlist:nn{ - \IfValueTF{#2}{#2}{triggerocg=onmouseup} + \IfValueTF{#2}{#2}{onmouseup} }{#3} \tl_set_eq:NN\l_ocgxii_toswitch_e_tl\l_ocgxii_e_list_tl \tl_set_eq:NN\l_ocgxii_toswitch_x_tl\l_ocgxii_x_list_tl \tl_set_eq:NN\l_ocgxii_toswitch_d_tl\l_ocgxii_d_list_tl \tl_set_eq:NN\l_ocgxii_toswitch_u_tl\l_ocgxii_u_list_tl \ocgxii_ocglist_process_idlist:nn{ - \IfValueTF{#2}{#2}{triggerocg=onmouseup} + \IfValueTF{#2}{#2}{onmouseup} }{#4} \tl_set_eq:NN\l_ocgxii_toshow_e_tl\l_ocgxii_e_list_tl \tl_set_eq:NN\l_ocgxii_toshow_x_tl\l_ocgxii_x_list_tl \tl_set_eq:NN\l_ocgxii_toshow_d_tl\l_ocgxii_d_list_tl \tl_set_eq:NN\l_ocgxii_toshow_u_tl\l_ocgxii_u_list_tl \ocgxii_ocglist_process_idlist:nn{ - \IfValueTF{#2}{#2}{triggerocg=onmouseup} + \IfValueTF{#2}{#2}{onmouseup} }{#5} \tl_set_eq:NN\l_ocgxii_tohide_e_tl\l_ocgxii_e_list_tl \tl_set_eq:NN\l_ocgxii_tohide_x_tl\l_ocgxii_x_list_tl @@ -487,23 +490,39 @@ % (additional actions) dict /Subtype/Widget/Ff~65536/FT/Btn/BS<> /T~(ocgx2@\int_use:N\g_ocgxii_widcount_int) + %treat mouse-up as mouse-click --> handle through /A dictionary + \str_if_eq_x:nnF{}{ + \l_ocgxii_toswitch_u_tl\l_ocgxii_toshow_u_tl\l_ocgxii_tohide_u_tl + }{ + /A <> + } /AA << - \str_if_eq_x:nnF{}{ - \l_ocgxii_toswitch_u_tl\l_ocgxii_toshow_u_tl\l_ocgxii_tohide_u_tl - }{ - /U <> - } - \str_if_eq_x:nnF{}{ + %\str_if_eq_x:nnF{}{ + % \l_ocgxii_toswitch_u_tl\l_ocgxii_toshow_u_tl\l_ocgxii_tohide_u_tl + %}{ + % /U <> + %} + \str_if_eq_x:nnF{}{ % mouse-down \l_ocgxii_toswitch_d_tl\l_ocgxii_toshow_d_tl\l_ocgxii_tohide_d_tl }{ /D <> } - \str_if_eq_x:nnF{}{ + \str_if_eq_x:nnF{}{ % mouse-enter \l_ocgxii_toswitch_e_tl\l_ocgxii_toshow_e_tl\l_ocgxii_tohide_e_tl }{ /E <> } - \str_if_eq_x:nnF{}{ + \str_if_eq_x:nnF{}{ % mouse-exit \l_ocgxii_toswitch_x_tl\l_ocgxii_toshow_x_tl\l_ocgxii_tohide_x_tl }{ /X <> }{ - %mouse-up only only needs annot with /Link subtype + %mouse-up alone may go with simple /Link annot /Subtype/Link /A <