summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-05-28 21:24:49 +0000
committerKarl Berry <karl@freefriends.org>2019-05-28 21:24:49 +0000
commitff947adcf28811e9317f2e7da9ea71c5b31a3f8c (patch)
treec27da2fd25deb88b0165497594d2b71f15aad110 /Master
parent0411921af7908fa9daf388b67db154e9fc51caca (diff)
ocgx2 (28may19)
git-svn-id: svn://tug.org/texlive/trunk@51249 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/ocgx2/ChangeLog6
-rw-r--r--Master/texmf-dist/doc/latex/ocgx2/README.txt70
-rw-r--r--Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty51
3 files changed, 99 insertions, 28 deletions
diff --git a/Master/texmf-dist/doc/latex/ocgx2/ChangeLog b/Master/texmf-dist/doc/latex/ocgx2/ChangeLog
index db7e8bbe97d..396585d5147 100644
--- a/Master/texmf-dist/doc/latex/ocgx2/ChangeLog
+++ b/Master/texmf-dist/doc/latex/ocgx2/ChangeLog
@@ -1,3 +1,9 @@
+2019-05-28
+ * v0.42: ocgx2.sty
+ * new: `ocmd' TikZ style added; option `radiobtngrp' renamed to
+ `radiobtngrps' and accepting multiple RB group names passed as a
+ comma-separated list (`radiobtngrp' still available as an alias)
+
2019-05-24
* v0.41: ocgx2.sty
* v0.15: ocgbase.sty
diff --git a/Master/texmf-dist/doc/latex/ocgx2/README.txt b/Master/texmf-dist/doc/latex/ocgx2/README.txt
index 87ef4e555ef..93aa14723f2 100644
--- a/Master/texmf-dist/doc/latex/ocgx2/README.txt
+++ b/Master/texmf-dist/doc/latex/ocgx2/README.txt
@@ -33,7 +33,7 @@ with the `animate' and `media9' packages.
+ PDF layers extending over page breaks
+ OCMDs (Optional Content Membership Dictionaries) for creating layers
- with complex visibility dependency
+ with complex visibility dependency
+ grouping OCGs into Radio Button Groups
+ additional keys for the TikZ interface of package `ocgx'
+ re-implementing `hyperref's `ocgcolorlinks' option for creating
@@ -51,35 +51,43 @@ with the `animate' and `media9' packages.
... material to be put on a PDF layer ...
\end{ocg}
+<layer name> is the name shown in the PDF viewer's "Layers" panel,
+<OCG id> is an identifier used for referencing the layer elsewhere in the
+document (e. g. layer switching buttons, visibility configuration of an `ocmd'
+environment, re-opening the OCG at another place using the `ocg' environment).
+
+<initial visibility> is `on', `true', `1' or `off', `false', `0'.
+
\begin{ocmd}[<OCMD id>]{[<visibility policy>][,<visibility expression>]}
... material to be put on a PDF layer ...
visibility calculated by <visibility expression> (Boolean expression) from
other OCGs visibility, or according to <visibility policy>
\end{ocmd}
-With <initial visibility> = ( on | true | 1 ) | ( off | false | 0 )
-and <options> : viewocg = always | never | ifvisible
- printocg = always | never | ifvisible
- exportocg = always | never | ifvisible
+Package and `ocg' environment options:
- not in ocgx, ocg-p:
+ viewocg = always | never | ifvisible
+ printocg = always | never | ifvisible
+ exportocg = always | never | ifvisible
- showingui (to be preferred over `listintoolbar' of ocgx/ocg-p)
- radiobtngrp = <group name> (string; environment-only option)
+ not in ocgx, ocg-p:
- tikz (package-only option)
- ocgcolorlinks (package-only option)
+ showingui (to be preferred over `listintoolbar' of ocgx/ocg-p)
+ radiobtngrps = {<group name 1>[,<group name 2>[, ...]]}
+
+ tikz (package-only option)
+ ocgcolorlinks (package-only option)
Package options have global scope. Environment options override package
options locally.
-Layers can be added to one or several Radio Button Groups using the new
-option `radiobtngrp'. From all layers within a Radio Button Group only
-one can be enabled at a time. Enabling a layer, e. g. in the Layers tab
-of the PDF viewer, automatically hides the previously visible layer.
-Option `radiobtngrp' can be used repeatedly for the same OCG in order
-to add the layer to more than one Radio Button Group.
+OCGs can be added to one or multiple Radio Button Groups using the new
+option `radiobtngrps'. From all OCGs within a Radio Button Group only _one_
+can be enabled at a time. Enabling an OCG, e. g. in the Layers tab of the PDF
+viewer, automatically hides the previously visible OCG in the group. An OCG
+can be added to multiple Radio Button Groups, passing a comma-separated list of
+group names. Such a list must be enclosed in braces, `{...}'.
`ocg' as well as `ocmd' environments can be nested and span multiple pages.
@@ -215,13 +223,35 @@ their usage:
texdoc ocgx
-The key `/tikz/ocg/opts' was added to the list in section
-`How to add TikZ scopes into OCGs' in the `ocgx' manual:
+Package `ocgx2' adds the key `/tikz/ocg/opts' to the list in section ``How to
+add TikZ scopes into OCGs'" in the `ocgx' manual:
/tikz/ocg/opts={<OCG options>}
-It allows passing `ocg'-environment options (`viewocg', `printocg', `exportocg',
-`showingui', `radiobtngrp') to the TikZ scope.
+It can be used inside the `ocg' style
+
+ \begin{scope}[
+ ocg={ref=..., name=..., opts={..., ...}},
+ ...
+ ]
+ ...
+ \end{scope}
+
+and allows passing `ocg'-environment options (`viewocg', `printocg', `exportocg',
+`showingui', `radiobtngrps') to the 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:
+
+ \begin{scope}[
+ ocmd={ref=..., visibility=...},
+ ...
+ ]
+ ...
+ \end{scope}
+
Moreover, TikZ objects to be turned into OCG switching hyperlinks (section "How
to transform nodes or paths into clickable links" in the `ocgx' manual) accept
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={