summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-01-23 22:14:06 +0000
committerKarl Berry <karl@freefriends.org>2015-01-23 22:14:06 +0000
commit1629ee2d9b45fd39a05ba75bc313e2e4061899e9 (patch)
tree44717000653efacc4ce34cda053831788f479290
parentc6f0d41b73cecfa8ec748d22ab7400584af6e6b4 (diff)
fixocgx (23jan15)
git-svn-id: svn://tug.org/texlive/trunk@36126 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/fixocgx/README41
-rw-r--r--Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty191
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check3
-rw-r--r--Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc1
-rw-r--r--Master/tlpkg/tlpsrc/fixocgx.tlpsrc0
5 files changed, 235 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/fixocgx/README b/Master/texmf-dist/doc/latex/fixocgx/README
new file mode 100644
index 00000000000..9b618c3b652
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/fixocgx/README
@@ -0,0 +1,41 @@
+==================================
+ The `fixocgx' LaTeX Package
+
+ Version 0.1 [2015/01/23]
+
+ (C) 2015--\today Alexander Grahn
+==================================
+
+Extends the usability of the OCGX package by Paul Gaborit to all known
+engines including:
+
+ * LaTeX --> dvips --> ps2pdf/Distiller
+ * (Xe)LaTeX --> (x)dvipdfmx
+
+ (PdfLaTeX and LuaLaTeX are already supported by `ocgx'.)
+
+To enable dvipdfmx support, pass `dvipdfmx' globally as a class option.
+
+Also, it ensures compatibility with the `media9' and `animate' packages.
+
+Must be loaded /after/ one of
+
+ \usepackage{ocgx}
+or
+ \usetikzlibrary{ocgx}
+
+For details about the usage, read the `ocgx' package manual.
+
+The `ocg' environment is documented in the `ocg-p' package manual. No
+attempt was made to fix the remaining commands from the `ocg-p' package
+as these are substituted by the commands from `ocgx'.
+
+
+ * * *
+
+
+This material is subject to the LaTeX Project Public License. See
+
+ http://mirrors.ctan.org/help/Catalogue/licenses.lppl.html
+
+for the details of that license.
diff --git a/Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty b/Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty
new file mode 100644
index 00000000000..a0b43e76df6
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/fixocgx/fixocgx.sty
@@ -0,0 +1,191 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% fixocgx.sty
+%
+% Copyright 2015--\today, Alexander Grahn
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This package extends the usability of `ocgx' to all known engines including
+% latex+dvips+ps2pdf, xelatex and latex+dvipdfmx.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://mirrors.ctan.org/help/Catalogue/licenses.lppl.html
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is A. Grahn.
+
+\RequirePackage{xparse}
+\RequirePackage{atenddvi}
+
+\@ifpackageloaded{ocgx}{}{
+ \PackageError{fixocgx}{%
+ Package `fixocgx' must be loaded /after/ one of\MessageBreak
+ \space\space\string\usepackage{ocgx}\MessageBreak
+ or\MessageBreak
+ \space\space\string\usetikzlibrary{ocgx}
+ }{}%
+}
+
+\AtBeginDocument{
+ \@ifpackageloaded{media9}{}{\RequirePackage{media9}}
+ \@ifpackagelater{media9}{2015/01/21}{}{
+ \PackageError{fixocgx}{%
+ Requires package `media9' v0.49 [2015/01/21] or\MessageBreak
+ newer, but only v\g@mix@version@tl\space[\g@mix@date@tl] is available
+ }{}%
+ }
+}
+
+\ProvidesExplPackage{fixocgx}{2015/01/23}{0.1}
+{ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx}
+
+%re-implement ocg-p's `ocg' environment
+\DeclareDocumentEnvironment{ocg}{O{}mmm}{
+ \bool_if:NT\g_fxocg_nestedB_bool{\tl_gput_right:Nx\@ocgbase@ocgorder{~[}}
+ \bool_gset_true:N\g_fxocg_nestedB_bool
+ \bool_gset_false:N\g_fxocg_nestedE_bool
+ \group_begin:
+ \tl_if_exist:cTF{#3}{ %re-open existing layer
+ \tl_set:Nx\l_tempa_tl{[ocgp]{ocg}{\use:c{#3.opts},#1}}
+ \exp_after:wN\setkeys\l_tempa_tl
+ \int_compare:nT{\@ocgp@listno=\c_zero}{
+ \tl_gput_right:Nx\@ocgbase@ocgorder{~\use:c{#3}}
+ }
+ }{
+ \tl_gset:cn{#3.opts}{#1}
+ \setkeys[ocgp]{ocg}{#1}
+ \mix_pdfobj:nnn{}{dict}{
+ /Type/OCG/Name~(#2)/Usage<<\@ocgp@print\@ocgp@export>>
+ }
+ \tl_gput_right:Nx\@ocgbase@ocgs{\space\g_mix_pdflastobj_tl}
+ \int_compare:nT{#4==\c_zero}{
+ \tl_gput_right:Nx\@ocgbase@offocgs{\space\g_mix_pdflastobj_tl}
+ }
+ \tl_gset:cx{#3}{\g_mix_pdflastobj_tl}
+ \tl_gset:cx{OCGpdfobj#3}{\g_mix_pdflastobj_tl}
+ \int_compare:nF{\@ocgp@listno=\c_one}{
+ \tl_gput_right:Nx\@ocgbase@ocgorder{~\g_mix_pdflastobj_tl}
+ }
+ }
+ \group_end:
+ \mix_pdfbdc:nn{/OC}{\use:c{#3}}
+ \ignorespaces
+}{
+ \unskip
+ \mix_pdfemc:
+ \bool_if:NT\g_fxocg_nestedE_bool{\tl_gput_right:Nx\@ocgbase@ocgorder{~]}}
+ \bool_gset_true:N\g_fxocg_nestedE_bool
+ \bool_gset_false:N\g_fxocg_nestedB_bool
+}
+\bool_new:N\g_fxocg_nestedB_bool % nested OCG begin
+\bool_new:N\g_fxocg_nestedE_bool % nested OCG end
+
+%re-implement commands from ocgx.sty (all engines including ps2pdf [gs>=9.15])
+\long\def\switchocg#1#2{
+ \tl_set:Nn\l_fxocg_ocglist_tl{}
+ \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#1}
+ \seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
+ \tl_put_right:Nx\l_fxocg_ocglist_tl{~\use:c{OCGpdfobj\l_tempa_tl}}
+ }
+ \leavevmode
+ \mix_pdflink:nn{
+ /Subtype/Link
+ /A <</S/SetOCGState /State [/Toggle~\l_fxocg_ocglist_tl]>>
+ /Border [0~0~0]
+ }{#2}
+}
+
+\long\def\showocg#1#2{
+ \tl_set:Nn\l_fxocg_ocglist_tl{}
+ \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#1}
+ \seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
+ \tl_put_right:Nx\l_fxocg_ocglist_tl{~\use:c{OCGpdfobj\l_tempa_tl}}
+ }
+ \leavevmode
+ \mix_pdflink:nn{
+ /Subtype/Link
+ /A <</S/SetOCGState/State [/ON~\l_fxocg_ocglist_tl]>>
+ /Border [0~0~0]
+ }{#2}
+}
+
+\long\def\hideocg#1#2{
+ \tl_set:Nn\l_fxocg_ocglist_tl{}
+ \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#1}
+ \seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
+ \tl_put_right:Nx\l_fxocg_ocglist_tl{~\use:c{OCGpdfobj\l_tempa_tl}}
+ }
+ \leavevmode
+ \mix_pdflink:nn{
+ /Subtype/Link
+ /A <</S/SetOCGState/State [/OFF~\l_fxocg_ocglist_tl]>>
+ /Border [0~0~0]
+ }{#2}
+}
+
+\long\def\actionsocg#1#2#3#4{
+ \tl_set:Nn\l_fxocg_toswitch_tl{}
+ \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#1}
+ \seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
+ \tl_put_right:Nx\l_fxocg_toswitch_tl{~\use:c{OCGpdfobj\l_tempa_tl}}
+ }
+ \tl_set:Nn\l_fxocg_toshow_tl{}
+ \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#2}
+ \seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
+ \tl_put_right:Nx\l_fxocg_toshow_tl{~\use:c{OCGpdfobj\l_tempa_tl}}
+ }
+ \tl_set:Nn\l_fxocg_tohide_tl{}
+ \seq_set_split:Nnn\l_fxocg_ocglistarg_seq{~}{#3}
+ \seq_map_variable:NNn\l_fxocg_ocglistarg_seq\l_tempa_tl{
+ \tl_put_right:Nx\l_fxocg_tohide_tl{~\use:c{OCGpdfobj\l_tempa_tl}}
+ }
+ \leavevmode
+ \mix_pdflink:nn{
+ /Subtype/Link
+ /A <</S/SetOCGState
+ /State [
+ /Toggle~\l_fxocg_toswitch_tl~/ON~\l_fxocg_toshow_tl
+ /OFF~\l_fxocg_tohide_tl
+ ]
+ >>
+ /Border [0~0~0]
+ }{#4}
+}
+
+\group_begin:
+\char_set_catcode_active:N\+\let+\space
+\tl_gset:Nx\g_fxocg_gsoldwarning_tl{
+ {product~(Ghostscript)~search~{pop~pop~pop~true}{pop~false}ifelse~
+ revision~915~lt~and~{
+ (\token_to_str:N\n
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n
+ @@++++++++++++Warning:+Ghostscript+too+old!++++++++++++++++@@\token_to_str:N\n
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n
+ @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n
+ @@+Package+`fixocgx'+requires+Ghostscript+version+>=+9.15.+@@\token_to_str:N\n
+ @@+Otherwise,+PDF+layers+will+not+work.++++++++++++++++++++@@\token_to_str:N\n
+ @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n
+ @@+Get+current+version+from++++++++++++++++++++++++++++++++@@\token_to_str:N\n
+ @@+http://www.ghostscript.com/download+++++++++++++++++++++@@\token_to_str:N\n
+ @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n)
+ print}~if}~?pdfmark
+}
+\group_end:
+
+\AtBeginDocument{
+ \ifpdf\else
+ \bool_if:NF\g_mix_dvipdfmx_bool{
+ \AtEndDvi{\special{ps::[nobreak]\g_fxocg_gsoldwarning_tl}}
+ }
+ \fi
+}
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index d37e7adb841..c1e0c6554ce 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -208,7 +208,8 @@ my @TLP_working = qw(
fifinddo-info fifo-stack fig4latex figbas figbib figflow figsize
filecontents filedate filehook fileinfo filemod
findhyph fink finstrut fira first-latex-doc
- fix2col fixfoot fixlatvian fixltxhyph fixme fixmetodonotes fixpdfmag
+ fix2col fixfoot fixlatvian fixltxhyph fixme fixmetodonotes
+ fixocgx fixpdfmag
fjodor
flabels flacards flagderiv flashcards flashmovie flipbook flippdf
float floatflt floatrow
diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
index bc14a7b4ec4..795f578ac06 100644
--- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
@@ -309,6 +309,7 @@ depend finstrut
depend fixfoot
depend fixme
depend fixmetodonotes
+depend fixocgx
depend fjodor
depend flabels
depend flacards
diff --git a/Master/tlpkg/tlpsrc/fixocgx.tlpsrc b/Master/tlpkg/tlpsrc/fixocgx.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/fixocgx.tlpsrc