texlive[51249] Master/texmf-dist: ocgx2 (28may19)

commits+karl at tug.org commits+karl at tug.org
Tue May 28 23:24:49 CEST 2019


Revision: 51249
          http://tug.org/svn/texlive?view=revision&revision=51249
Author:   karl
Date:     2019-05-28 23:24:49 +0200 (Tue, 28 May 2019)
Log Message:
-----------
ocgx2 (28may19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/ocgx2/ChangeLog
    trunk/Master/texmf-dist/doc/latex/ocgx2/README.txt
    trunk/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty

Modified: trunk/Master/texmf-dist/doc/latex/ocgx2/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ocgx2/ChangeLog	2019-05-28 21:24:36 UTC (rev 51248)
+++ trunk/Master/texmf-dist/doc/latex/ocgx2/ChangeLog	2019-05-28 21:24:49 UTC (rev 51249)
@@ -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

Modified: trunk/Master/texmf-dist/doc/latex/ocgx2/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ocgx2/README.txt	2019-05-28 21:24:36 UTC (rev 51248)
+++ trunk/Master/texmf-dist/doc/latex/ocgx2/README.txt	2019-05-28 21:24:49 UTC (rev 51249)
@@ -33,7 +33,7 @@
 
     +  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,6 +51,13 @@
     ... 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
@@ -57,29 +64,30 @@
     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,14 +223,36 @@
 
   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
 the additional key

Modified: trunk/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty	2019-05-28 21:24:36 UTC (rev 51248)
+++ trunk/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty	2019-05-28 21:24:49 UTC (rev 51249)
@@ -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 at ocgxii@date at tl{2019/05/24}
-\def\g at ocgxii@version at tl{0.41}
+\def\g at ocgxii@date at tl{2019/05/28}
+\def\g at ocgxii@version at tl{0.42}
 
 \ProvidesExplPackage{ocgx2}{\g at ocgxii@date at tl}{\g at ocgxii@version at 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
 %
-%  - TikZ objects to be turned into ocg switching links accept the additional
+%  - 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
 %    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 at ocmdref]{\ocgxii at ocmdvisibility}%
+    },
+    /tikz/execute at end scope={\end{ocmd}},
+    /tikz/.cd
+  },
+  ocmd={
+    % parameters
+    ref/.store in=\ocgxii at ocmdref,
+    visibility/.store in=\ocgxii at ocmdvisibility,
+    % default values
+    ref=,
+    visibility=,
+  },
   trigger ocg/.store in=\ocgxii at trigger,
   trigger ocg/.value required,
   switch ocg/.style={



More information about the tex-live-commits mailing list