summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-06-15 23:21:00 +0000
committerKarl Berry <karl@freefriends.org>2015-06-15 23:21:00 +0000
commitcf42134e440c3c49b1222d85301251e312f85fa5 (patch)
tree2d929c9b592ebf2d608fb97b4ef80e277da53d98
parentf13b86e724e8e0dbf92343b0126f84e25f216b4b (diff)
fixocgx (15jun15)
git-svn-id: svn://tug.org/texlive/trunk@37548 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/fixocgx/ChangeLog8
-rw-r--r--Master/texmf-dist/doc/latex/fixocgx/README2
-rw-r--r--Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty62
3 files changed, 46 insertions, 26 deletions
diff --git a/Master/texmf-dist/doc/latex/fixocgx/ChangeLog b/Master/texmf-dist/doc/latex/fixocgx/ChangeLog
index 3d5b65e1d64..e4d34991e55 100644
--- a/Master/texmf-dist/doc/latex/fixocgx/ChangeLog
+++ b/Master/texmf-dist/doc/latex/fixocgx/ChangeLog
@@ -1,3 +1,11 @@
+2015-06-15
+ * v0.5
+ * Fix: OCG ID lists with leading/trailings spaces passed as
+ argument to the OCG visibilty setting commands caused an error; the same
+ with empty arguments.
+ Improved behaviour of visibilty setting links that are themselves
+ part of OCGs.
+
2015-03-16
* v0.4
* Fix: no more PS specials from `ocg-p.sty' in dvipdfmx mode
diff --git a/Master/texmf-dist/doc/latex/fixocgx/README b/Master/texmf-dist/doc/latex/fixocgx/README
index 461d5af05b9..d072c3d31aa 100644
--- a/Master/texmf-dist/doc/latex/fixocgx/README
+++ b/Master/texmf-dist/doc/latex/fixocgx/README
@@ -1,7 +1,7 @@
==================================
The `fixocgx' LaTeX Package
- Version 0.4 [2015/03/16]
+ Version 0.5 [2015/06/15]
(C) 2015--\today Alexander Grahn
==================================
diff --git a/Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty b/Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty
index b3db3ee36e0..b40059ee689 100644
--- a/Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty
+++ b/Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty
@@ -52,7 +52,7 @@
}
}
-\ProvidesExplPackage{fixocgx}{2015/03/16}{0.4}
+\ProvidesExplPackage{fixocgx}{2015/06/15}{0.5}
{ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx}
%re-implement ocg-p's `ocg' environment
@@ -140,71 +140,81 @@
}
%re-implement commands from ocgx.sty (all engines including ps2pdf [gs>=9.15])
-\long\def\switchocg#1#2{
+\DeclareDocumentCommand\switchocg{mm}{
\tl_set:Nn\l_fxocg_ocglist_tl{}
- \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#1}
+ \tl_set:Nx\l_ocglistarg_tl{#1}\tl_trim_spaces:N\l_ocglistarg_tl
+ \seq_set_split:NnV\l_fxocg_ocglistarg_seq{~}\l_ocglistarg_tl
\seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
\fxocg_process_ocgref:NN\l_fxocg_ocglist_tl\l_tempa_tl
}
\leavevmode
\fxocg_pdflink:nn{
- /Subtype/Link
- /A <</S/SetOCGState /State [/Toggle~\l_fxocg_ocglist_tl]>>
+ /Subtype/Link\fxocg@insert@OC
+ /A <</S/SetOCGState/State [
+ \str_if_eq:VnF{\l_fxocg_ocglist_tl}{}{/Toggle~\l_fxocg_ocglist_tl}]>>
/Border [0~0~0]
}{#2}
}
-\long\def\showocg#1#2{
+\DeclareDocumentCommand\showocg{mm}{
\tl_set:Nn\l_fxocg_ocglist_tl{}
- \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#1}
+ \tl_set:Nx\l_ocglistarg_tl{#1}\tl_trim_spaces:N\l_ocglistarg_tl
+ \seq_set_split:NnV\l_fxocg_ocglistarg_seq{~}\l_ocglistarg_tl
\seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
\fxocg_process_ocgref:NN\l_fxocg_ocglist_tl\l_tempa_tl
}
\leavevmode
\fxocg_pdflink:nn{
- /Subtype/Link
- /A <</S/SetOCGState/State [/ON~\l_fxocg_ocglist_tl]>>
+ /Subtype/Link\fxocg@insert@OC
+ /A <</S/SetOCGState/State [
+ \str_if_eq:VnF{\l_fxocg_ocglist_tl}{}{/ON~\l_fxocg_ocglist_tl}]>>
/Border [0~0~0]
}{#2}
}
-\long\def\hideocg#1#2{
+\DeclareDocumentCommand\hideocg{mm}{
\tl_set:Nn\l_fxocg_ocglist_tl{}
- \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#1}
+ \tl_set:Nx\l_ocglistarg_tl{#1}\tl_trim_spaces:N\l_ocglistarg_tl
+ \seq_set_split:NnV\l_fxocg_ocglistarg_seq{~}\l_ocglistarg_tl
\seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
\fxocg_process_ocgref:NN\l_fxocg_ocglist_tl\l_tempa_tl
}
\leavevmode
\fxocg_pdflink:nn{
- /Subtype/Link
- /A <</S/SetOCGState/State [/OFF~\l_fxocg_ocglist_tl]>>
+ /Subtype/Link\fxocg@insert@OC
+ /A <</S/SetOCGState/State [
+ \str_if_eq:VnF{\l_fxocg_ocglist_tl}{}{/OFF~\l_fxocg_ocglist_tl}]>>
/Border [0~0~0]
}{#2}
}
-\long\def\actionsocg#1#2#3#4{
+\DeclareDocumentCommand\actionsocg{mmmm}{
+ \tl_set:Nx\l_ocglistarg_tl{#1}\tl_trim_spaces:N\l_ocglistarg_tl
\tl_set:Nn\l_fxocg_toswitch_tl{}
- \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#1}
+ \seq_set_split:NnV\l_fxocg_ocglistarg_seq{~}\l_ocglistarg_tl
\seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
\fxocg_process_ocgref:NN\l_fxocg_toswitch_tl\l_tempa_tl
}
+ \tl_set:Nx\l_ocglistarg_tl{#2}\tl_trim_spaces:N\l_ocglistarg_tl
\tl_set:Nn\l_fxocg_toshow_tl{}
- \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#2}
+ \seq_set_split:NnV\l_fxocg_ocglistarg_seq{~}\l_ocglistarg_tl
\seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
\fxocg_process_ocgref:NN\l_fxocg_toshow_tl\l_tempa_tl
}
+ \tl_set:Nx\l_ocglistarg_tl{#3}\tl_trim_spaces:N\l_ocglistarg_tl
\tl_set:Nn\l_fxocg_tohide_tl{}
- \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#3}
+ \seq_set_split:NnV\l_fxocg_ocglistarg_seq{~}\l_ocglistarg_tl
\seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
\fxocg_process_ocgref:NN\l_fxocg_tohide_tl\l_tempa_tl
}
\leavevmode
\fxocg_pdflink:nn{
- /Subtype/Link
+ /Subtype/Link\fxocg@insert@OC
/A <</S/SetOCGState
/State [
- /Toggle~\l_fxocg_toswitch_tl~/ON~\l_fxocg_toshow_tl
- /OFF~\l_fxocg_tohide_tl
+ \str_if_eq:VnF{\l_fxocg_toswitch_tl}{}{/Toggle~\l_fxocg_toswitch_tl}~
+ \str_if_eq:VnF{\l_fxocg_toshow_tl}{}{/ON~\l_fxocg_toshow_tl}~
+ \str_if_eq:VnF{\l_fxocg_tohide_tl}{}{/OFF~\l_fxocg_tohide_tl}
]
>>
/Border [0~0~0]
@@ -212,11 +222,13 @@
}
\cs_new:Nn\fxocg_process_ocgref:NN{
- \tl_if_exist:cTF{OCGpdfobj#2}{\tl_put_right:Nx#1{~\use:c{OCGpdfobj#2}}}{
- \msg_warning:nnx{fixocgx}{undefined~OCG}{#2}
- \cs_if_exist:NF\g_fxocg_refundefwarned_tl{
- \tl_new:N\g_fxocg_refundefwarned_tl
- \AtEndDocument{\msg_warning:nn{fixocgx}{undefined~OCGs}}
+ \str_if_eq_x:nnF{#2}{}{
+ \tl_if_exist:cTF{OCGpdfobj#2}{\tl_put_right:Nx#1{~\use:c{OCGpdfobj#2}}}{
+ \msg_warning:nnx{fixocgx}{undefined~OCG}{#2}
+ \cs_if_exist:NF\g_fxocg_refundefwarned_tl{
+ \tl_new:N\g_fxocg_refundefwarned_tl
+ \AtEndDocument{\msg_warning:nn{fixocgx}{undefined~OCGs}}
+ }
}
}
}