summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ocgx2
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/ocgx2')
-rw-r--r--Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty51
1 files changed, 43 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
index 404d849b962..c3b27b12b20 100644
--- a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
+++ b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
@@ -37,11 +37,19 @@
%
% The Current Maintainer of this work is A. Grahn.
+%process non-detectable dvipdfmx driver for passing to expl3
+\RequirePackage{xkeyval}
+\DeclareOptionX{dvipdfmx}{%
+ \PassOptionsToPackage{dvipdfmx}{ocgbase}
+ \PassOptionsToPackage{driver=dvipdfmx}{expl3}
+}
+\DeclareOptionX*{}\ProcessOptionsX*\relax %allow anything as an option
+
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
-\def\g@ocgxii@date@tl{2019/05/24}
-\def\g@ocgxii@version@tl{0.41}
+\def\g@ocgxii@date@tl{2019/05/28}
+\def\g@ocgxii@version@tl{0.42}
\ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl}
{ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx}
@@ -940,11 +948,15 @@
listintoolbar .meta:n = {showingui=#1},
listintoolbar .default:n={true},
- radiobtngrp .code:n = {
- \seq_if_in:NxF\l_ocgxii_rbgrps_seq{#1}{
- \seq_put_right:Nx\l_ocgxii_rbgrps_seq{#1}
- }
+ radiobtngrps .code:n = {
+ \clist_map_inline:nn{#1}{
+ \seq_if_in:NxF\l_ocgxii_rbgrps_seq{##1}{
+ \seq_put_right:Nx\l_ocgxii_rbgrps_seq{##1}
+ }
+ }
},
+ radiobtngrps .value_required:n = {true},
+ radiobtngrp .meta:n={radiobtngrps={#1}},
radiobtngrp .value_required:n = {true}
}
@@ -1190,9 +1202,15 @@
% taken in large parts from Paul Gaborit's `tikzlibraryocgx.code.tex' with
% some additions/fixes:
%
-% - opts={...} allows ocg-environment options to be passed to a TikZ scope
+% - opts={...} inside ocg={...} allows ocg-environment options to be passed
+% to a TikZ scope
+%
+% - The style ocmd={...} is another way for turning a TikZ scope into a PDF
+% layer (in addition to ocg={...}). It has two sub-keys, ref={...} and
+% visibility={...}, which have the same meaning as the optional and the
+% mandatory arguments of the `ocmd' environment
%
-% - TikZ objects to be turned into ocg switching links accept the additional
+% - TikZ objects to be turned into OCG switching links accept the additional
% key
%
% trigger ocg = onmousenter | onmouseexit | onmousedown | onmouseup |
@@ -1232,6 +1250,23 @@
/tikz/execute at end scope={\end{ocg}},
}
},
+ ocmd/.style={
+ ocmd/.cd,
+ #1,
+ /tikz/execute at begin scope={%
+ \begin{ocmd}[\ocgxii@ocmdref]{\ocgxii@ocmdvisibility}%
+ },
+ /tikz/execute at end scope={\end{ocmd}},
+ /tikz/.cd
+ },
+ ocmd={
+ % parameters
+ ref/.store in=\ocgxii@ocmdref,
+ visibility/.store in=\ocgxii@ocmdvisibility,
+ % default values
+ ref=,
+ visibility=,
+ },
trigger ocg/.store in=\ocgxii@trigger,
trigger ocg/.value required,
switch ocg/.style={