From 1b14d7809c520eb9ccb785f44c93c1616351f54e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 3 Dec 2022 21:01:29 +0000 Subject: pdfextra (3dec22) git-svn-id: svn://tug.org/texlive/trunk@65184 c570f23f-e606-0410-a88d-b1316a301751 --- .../optex/pdfextra/examples/pdfextra-example.pdf | Bin 385350 -> 385337 bytes .../texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf | Bin 245952 -> 232911 bytes Master/texmf-dist/tex/luatex/pdfextra/pdfextra.tex | 30 +++++++++++++-------- Master/texmf-dist/tex/optex/pdfextra/pdfextra.opm | 20 +++++++++++--- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.pdf b/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.pdf index 24ca714a755..1cf1a84dee8 100644 Binary files a/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.pdf and b/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.pdf differ diff --git a/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf b/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf index 9534e46bfac..a05e591fe1a 100644 Binary files a/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf and b/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf differ diff --git a/Master/texmf-dist/tex/luatex/pdfextra/pdfextra.tex b/Master/texmf-dist/tex/luatex/pdfextra/pdfextra.tex index cbbeca0c17d..a34a08b5aa0 100644 --- a/Master/texmf-dist/tex/luatex/pdfextra/pdfextra.tex +++ b/Master/texmf-dist/tex/luatex/pdfextra/pdfextra.tex @@ -41,6 +41,7 @@ \_else \_resetnamespace{#1}\_fi } \_def\_resetnamespace #1{% + \_unless \_ifx \_pkglabel\_empty \_endnamespace \_fi \_ea \_gdef \_csname namesp:#1\_endcsname {}% \_gdef \_pkglabel{_#1}% \_directlua{ @@ -156,13 +157,13 @@ \_private \string \newtoks \romannumeral ; +\_newtoks\_opt \_def\_optdef#1[#2]{% - \_def#1{\_opt={#2}\_isnextchar[{\_cs{_oA:\_string#1}}{\_cs{_oB:\_string#1}}}% - \_sdef{_oA:\_string#1}[##1]{\_opt={##1}\_cs{_oB:\_string#1\_nospaceafter}}% - \_sdef{_oB:\_string#1\_nospaceafter}% + \_def#1{\_opt={#2}\_isnextchar[{\_cs{_oA:\_csstring#1}}{\_cs{_oB:\_csstring#1}}}% + \_sdef{_oA:\_csstring#1}[##1]{\_opt={##1}\_cs{_oB:\_csstring#1\_nospaceafter}}% + \_sdef{_oB:\_csstring#1\_nospaceafter}% } -\_def\_nospaceafter#1{\_ea#1\_romannumeral-`\.} -\_newtoks\_opt +\_def\_nospaceafter#1{\_ea#1\_romannumeral-`\.\_noexpand} \_private \noexpand \catcode \toksapp ; @@ -172,7 +173,7 @@ \_catcode`!=3 \_catcode`?=3 \_def\_replstring #1#2#3{% \replstring #1{stringA}{stringB} \_long\_def\_replacestringsA##1#2{\_tmptoks{##1}\_replacestringsB}% - \_long\_def\_replacestringsB##1#2{\_ifx!##1\_relax \_else \_toksapp\_tmptoks{#3##1}% + \_long\_def\_replacestringsB##1#2{\_ifx!##1\_relax \_else \_tmptoks\_ea{\_the\_tmptoks#3##1}% \_ea\_replacestringsB\_fi}% \_ea\_replacestringsA #1?#2!#2% \_long\_def\_replacestringsA##1?{\_tmptoks{##1}\_edef#1{\_the\_tmptoks}}% @@ -233,16 +234,23 @@ \_immediate\_openout\_reffile={\_jobname.ref}\_relax \_gdef\_wref ##1##2{\_write\_reffile{\_bslash\_csstring##1##2}}% \_immediate\_write\_reffile {\_pcent\_pcent\_space pdfextra - REF file}% + \_ifx\_refdecldata\_empty \_else \_refdeclwrite \_fi \_gdef\_openref{}% } \_def\_ewref #1#2{\_edef\_ewrefA{#2}\_ea\_wref\_ea#1\_ea{\_ewrefA}} \_private \ifnum ; -\_def\_refdecl{\_bgroup \_catcode`\#=12 \_refdeclA} -\_def\_refdeclA #1{\_egroup\_openref - \_immediate\_write\_reffile {\_pcent\_space \_string \refdecl:}% - \_immediate\_write\_reffile {\_detokenize{#1}}% +\_def\_refdecldata{} +\_def\_refdecl{\_bgroup \_catcode`\#=12 \_catcode`\\=12 \_catcode`\ =12 \_refdeclA} +\_def\_refdeclA#1{\_egroup + \_ifx\_refdecldata\_empty\_else \_global\_addto\_refdecldata{^^J}\_fi + \_global\_addto\_refdecldata{#1}% + \_ifx\_openref\_empty \_refdeclwrite \_fi +} +\_def\_refdeclwrite{% + \_immediate\_write\_reffile{\_pcent\_space \_string\refdecl:^^J\_detokenize\_ea{\_refdecldata}}% + \_gdef\_refdecldata{}% } % @@ -267,7 +275,7 @@ % modified \_def\_pdfunidef#1#2{% \_edef\_tmp{#2}% - \_def#1{\_directlua{ + \_edef#1{\_directlua{ local str = token.scan_string() local out = { " +% https://github.com/vlasakm/pdfextra +% Zero-Clause BSD license + +\_def\_pdfextra_version{0.3} \_codedecl \RM {Extra PDF features (v\_pdfextra_version)} \_namespace{pdfextra} @@ -739,7 +743,7 @@ % file attachment \_def\.embeddedfiles{} -\_def\.attach[#1]{\.isfiledefined{\.name}\_iftrue +\_def\.attach[#1]{\.isfiledefined{#1}\_iftrue \.xaddto\.embeddedfiles{(#1) \.cs{filespec:#1} }\_fi } \_nspublic \attach ; @@ -1724,5 +1728,15 @@ \.mimetype{mp4}{video/mp4} \.mimetype{webm}{video/webm} +\.mimetype{tex}{application/x-tex} + + +% more or less legacy formats +\.mimetype{au}{audio/basic} +\.mimetype{aiff}{audio/x-aiff} +\.mimetype{mov}{video/quicktime} +\.mimetype{mpg}{video/mpeg} +\.mimetype{wmv}{video/x-ms-wmv} + \_endnamespace \_endcode -- cgit v1.2.3