summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-09-19 20:44:28 +0000
committerKarl Berry <karl@freefriends.org>2019-09-19 20:44:28 +0000
commit2e378b85eb329578a4cb53be1aa87e5bde94bb4d (patch)
treed482a098881aa3779eb61c15ee7a9ed428feb889 /Master/texmf-dist/tex
parent9203d6cf20ce502dd5734b6580acb245defcc6ab (diff)
ocgx2 (19sep19)
git-svn-id: svn://tug.org/texlive/trunk@52126 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty37
1 files changed, 25 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
index 2e6cbdf6aac..235fe5f90e4 100644
--- a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
+++ b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
@@ -48,8 +48,8 @@
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
-\def\g@ocgxii@date@tl{2019/09/17}
-\def\g@ocgxii@version@tl{0.44}
+\def\g@ocgxii@date@tl{2019/09/19}
+\def\g@ocgxii@version@tl{0.45}
\ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@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}}
}
}
}