texlive[52126] Master/texmf-dist: ocgx2 (19sep19)

commits+karl at tug.org commits+karl at tug.org
Thu Sep 19 22:44:29 CEST 2019


Revision: 52126
          http://tug.org/svn/texlive?view=revision&revision=52126
Author:   karl
Date:     2019-09-19 22:44:28 +0200 (Thu, 19 Sep 2019)
Log Message:
-----------
ocgx2 (19sep19)

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-09-19 20:44:15 UTC (rev 52125)
+++ trunk/Master/texmf-dist/doc/latex/ocgx2/ChangeLog	2019-09-19 20:44:28 UTC (rev 52126)
@@ -1,3 +1,8 @@
+2019-09-19
+	* v0.45: ocgx2.sty
+	* new: using comma for separating OCG ids in \showocg, \hideocg etc.; <space>
+	still accepted for compatibility with ocgx/ocg-p 
+
 2019-09-17
 	* v0.44: ocgx2.sty
 	* fix: wrong visibility of reopened ocg (introduced in v0.41)

Modified: trunk/Master/texmf-dist/doc/latex/ocgx2/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ocgx2/README.txt	2019-09-19 20:44:15 UTC (rev 52125)
+++ trunk/Master/texmf-dist/doc/latex/ocgx2/README.txt	2019-09-19 20:44:28 UTC (rev 52126)
@@ -151,9 +151,9 @@
 
 The available commands are
 
-  \switchocg[<trigger>]{<OCG ids to toggle, space separated>}{<link text>}
-  \showocg[<trigger>]{<OCG ids to switch ON, space separated>}{<link text>}
-  \hideocg[<trigger>]{<OCG ids to switch OFF, space separated>}{<link text>}
+  \switchocg[<trigger>]{<OCG ids to toggle, comma-separated>}{<link text>}
+  \showocg[<trigger>]{<OCG ids to switch ON, comma-separated>}{<link text>}
+  \hideocg[<trigger>]{<OCG ids to switch OFF, comma-separated>}{<link text>}
   \actionsocg[<trigger>]{<ids to toggle>}{<ids to switch ON>}{<ids to switch OFF>}{<link text>}
 
 For details about their usage, read the `ocgx' package manual:
@@ -168,14 +168,19 @@
 
 for  <trigger>. In order to listen to more than one mouse event, use
 `onmouseall'. Layer ids in the mandatory argument(s) must then be grouped with
-commas as follows:
+braces and commas as follows:
 
-  <mouse-enter group>, <mouse-exit group>, <mouse-down group>, <mouse-up group>
+  {<mouse-enter group>}, {<mouse-exit group>}, {<mouse-down group>}, {<mouse-up group>}
 
 Any of these groups may be left empty in order to configure only some
-mouse triggers. Inside the groups, OCG ids are separated by space.
+mouse triggers. Inside the groups, OCG ids are also separated by commas.
+Therefore, braces must be put around the groups. For example:
 
+  \switchocg[onmouseall]{
+    , , {ocg1, ocg2, ocg3, ocg4}, {ocg1, ocg2, ocg3, ocg4}
+  }{Toggle layers on mouse-down and -up}
 
+
 5. Package option `ocgcolorlinks'
 =================================
 

Modified: trunk/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty	2019-09-19 20:44:15 UTC (rev 52125)
+++ trunk/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty	2019-09-19 20:44:28 UTC (rev 52126)
@@ -48,8 +48,8 @@
 \RequirePackage{xparse}
 \RequirePackage{l3keys2e}
 
-\def\g at ocgxii@date at tl{2019/09/17}
-\def\g at ocgxii@version at tl{0.44}
+\def\g at ocgxii@date at tl{2019/09/19}
+\def\g at ocgxii@version at tl{0.45}
 
 \ProvidesExplPackage{ocgx2}{\g at ocgxii@date at tl}{\g at ocgxii@version at tl}
 {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx}
@@ -697,7 +697,22 @@
 
 \cs_new_protected_nopar:Nn\ocgxii_ocglist_build:Nn{
   \tl_set:Nx\l_ocglistarg_tl{#2}\tl_trim_spaces:N\l_ocglistarg_tl
-  \seq_set_split:NnV\l_ocgxii_ocglistarg_seq{~}\l_ocglistarg_tl
+  % first try splitting at commas (ocgx2 syntax)
+  \tl_set_eq:NN\l_tmpa_tl\l_ocglistarg_tl
+  \tl_remove_all:Nn\l_tmpa_tl{~}
+  \seq_set_split:NnV\l_ocgxii_ocglistarg_seq{,}\l_tmpa_tl
+  \seq_remove_all:Nn\l_ocgxii_ocglistarg_seq{}
+  \tl_set:Nx\l_tmpa_tl{\seq_count:N\l_ocgxii_ocglistarg_seq}
+  % now at spaces (legacy ocgx/ocg-p)
+  \tl_set_eq:NN\l_tmpb_tl\l_ocglistarg_tl
+  \tl_remove_all:Nn\l_tmpb_tl{,}
+  \seq_set_split:NnV\l_tmpb_seq{~}\l_tmpb_tl
+  \seq_remove_all:Nn\l_tmpb_seq{}
+  \tl_set:Nx\l_tmpb_tl{\seq_count:N\l_tmpb_seq}
+  %take the seq having more elements (guessing the separator most likely used)
+  \int_compare:nT{\l_tmpb_tl>\l_tmpa_tl}{
+    \seq_set_eq:NN\l_ocgxii_ocglistarg_seq\l_tmpb_seq
+  }
   \seq_map_variable:NNn\l_ocgxii_ocglistarg_seq\l_tempa_tl{
     \ocgxii_process_ocgref:NN#1\l_tempa_tl
   }
@@ -986,15 +1001,13 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \cs_new_protected:Nn\ocgxii_process_ocgref:NN{
-  \str_if_eq:eeF{#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
-        \AtEndDocument{\msg_warning:nn{ocgx2}{undefined~OCGs}}
-      }
+  \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
+      \AtEndDocument{\msg_warning:nn{ocgx2}{undefined~OCGs}}
     }
   }
 }



More information about the tex-live-commits mailing list