%% %% This is file `embedfile.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% embedfile.dtx (with options: `package') %% %% This is a generated file. %% %% Copyright (C) 2006, 2007 by Heiko Oberdiek %% %% 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://www.latex-project.org/lppl.txt %% 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". %% %% This Current Maintainer of this work is Heiko Oberdiek. %% %% This work consists of the main source file embedfile.dtx %% and the derived files %% embedfile.sty, embedfile.pdf, embedfile.ins, embedfile.drv, %% dtx-attach.sty, embedfile-example-plain.tex, %% embedfile-test1.tex, embedfile-test2.tex, %% embedfile-test3.tex. %% \begingroup \catcode44 12 % , \catcode45 12 % - \catcode46 12 % . \catcode58 12 % : \catcode64 11 % @ \expandafter\let\expandafter\x\csname ver@embedfile.sty\endcsname \ifcase 0% \ifx\x\relax % plain \else \ifx\x\empty % LaTeX \else 1% \fi \fi \else \expandafter\ifx\csname PackageInfo\endcsname\relax \def\x#1#2{% \immediate\write-1{Package #1 Info: #2.}% }% \else \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% \fi \x{embedfile}{The package is already loaded}% \endgroup \expandafter\endinput \fi \endgroup \begingroup \catcode40 12 % ( \catcode41 12 % ) \catcode44 12 % , \catcode45 12 % - \catcode46 12 % . \catcode47 12 % / \catcode58 12 % : \catcode64 11 % @ \expandafter\ifx\csname ProvidesPackage\endcsname\relax \def\x#1#2#3[#4]{\endgroup \immediate\write-1{Package: #3 #4}% \xdef#1{#4}% }% \else \def\x#1#2[#3]{\endgroup #2[{#3}]% \ifx#1\relax \xdef#1{#3}% \fi }% \fi \expandafter\x\csname ver@embedfile.sty\endcsname \ProvidesPackage{embedfile}% [2007/09/09 v1.2 embed files into PDF (HO)] \expandafter\edef\csname EmbedFile@AtEnd\endcsname{% \catcode64 \the\catcode64\relax } \catcode64 11 % @ \def\TMP@EnsureCode#1#2{% \edef\EmbedFile@AtEnd{% \EmbedFile@AtEnd \catcode#1 \the\catcode#1\relax }% \catcode#1 #2\relax } \TMP@EnsureCode{39}{12}% ' \TMP@EnsureCode{40}{12}% ( \TMP@EnsureCode{41}{12}% ) \TMP@EnsureCode{44}{12}% , \TMP@EnsureCode{46}{12}% . \TMP@EnsureCode{47}{12}% / \TMP@EnsureCode{58}{12}% : \TMP@EnsureCode{60}{12}% < \TMP@EnsureCode{61}{12}% = \TMP@EnsureCode{62}{12}% > \TMP@EnsureCode{91}{12}% [ \TMP@EnsureCode{93}{12}% ] \TMP@EnsureCode{96}{12}% ` \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname RequirePackage\endcsname\relax \def\EmbedFile@RequirePackage#1[#2]{% \input #1.sty\relax }% \else \let\EmbedFile@RequirePackage\RequirePackage \fi \EmbedFile@RequirePackage{infwarerr}[2007/09/09]% \def\EmbedFile@PackageError{% \@PackageError{embedfile}% } \EmbedFile@RequirePackage{ifpdf}[2007/09/09] \ifpdf \else \EmbedFile@PackageError{% Missing pdfTeX in PDF mode% }{% Currently other drivers are not supported. % Package loading is aborted.% }% \EmbedFile@AtEnd \expandafter\endinput \fi \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname pdffilesize\endcsname\relax \EmbedFile@PackageError{% Unsupported pdfTeX version% }{% At least version 1.30 is necessary. Package loading is aborted.% }% \EmbedFile@AtEnd \expandafter\endinput \fi \expandafter\ifx\csname define@key\endcsname\relax \chardef\EmbedFile@plain=\z@ \def\EmbedFile@temp#1{% \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname#1\endcsname\relax \chardef\EmbedFile@plain=\@ne \fi }% \EmbedFile@temp{NeedsTeXFormat}% \EmbedFile@temp{ProvidesPackage}% \EmbedFile@temp{DeclareOption}% \EmbedFile@temp{ExecuteOptions}% \EmbedFile@temp{ProcessOptions}% \ifnum\EmbedFile@plain=\@ne \def\EmbedFile@temp#1{% \expandafter\let\csname EmbedFile@Org#1\expandafter\endcsname \csname#1\endcsname \expandafter\def\csname#1\endcsname }% \EmbedFile@temp{NeedsTeXFormat}#1{}% \EmbedFile@temp{ProvidesPackage}#1[#2]{}% hash-ok \EmbedFile@temp{DeclareOption}#1{}% \EmbedFile@temp{ExecuteOptions}#1{}% \EmbedFile@temp{ProcessOptions}{}% \def\KV@errx#1{% \@PackageError{keyval}{#1}\@ehc }% \expandafter\ifx\csname @ifnextchar\endcsname\relax \def\@ifnextchar#1#2#3{% \let\reserved@d=#1% \def\reserved@a{#2}% \def\reserved@b{#3}% \futurelet\@let@token\@ifnch }% \def\@ifnch{% \ifx\@let@token\@sptoken \let\reserved@c\@xifnch \else \ifx\@let@token\reserved@d \let\reserved@c\reserved@a \else \let\reserved@c\reserved@b \fi \fi \reserved@c }% \begingroup \def\:{\global\let\@sptoken= }% \: % this makes \@sptoken a space token \def\:{\@xifnch}% \expandafter\gdef\: {% \futurelet\@let@token\@ifnch }% \endgroup \fi \expandafter\ifx\csname @namedef\endcsname\relax \def\@namedef#1{% \expandafter\def\csname#1\endcsname }% \fi \fi \EmbedFile@RequirePackage{keyval}[1999/03/16]% \ifnum\EmbedFile@plain=\@ne \def\EmbedFile@temp#1{% \expandafter\let\csname#1\expandafter\endcsname \csname EmbedFile@Org#1\endcsname }% \EmbedFile@temp{NeedsTeXFormat}% \EmbedFile@temp{ProvidesPackage}% \EmbedFile@temp{DeclareOption}% \EmbedFile@temp{ExecuteOptions}% \EmbedFile@temp{ProcessOptions}% \fi \fi \def\EmbedFile@DefineKey#1#2{% \define@key{EmbedFile}{#1}{% \expandafter\def\csname EmbedFile@#1\endcsname{##1}% }% \expandafter\def\csname EmbedFile@#1\endcsname{#2}% } \EmbedFile@DefineKey{mimetype}{} \EmbedFile@DefineKey{filespec}{\EmbedFile@file} \EmbedFile@DefineKey{filesystem}{} \EmbedFile@DefineKey{desc}{} \EmbedFile@DefineKey{stringmethod}{% \ifx\pdfstringdef\@undefined escape% \else \ifx\pdfstringdef\relax escape% \else psd% \fi \fi } \def\embedfilesetup{% \setkeys{EmbedFile}% } \def\embedfile{% \@ifnextchar[\EmbedFile@embedfile{\EmbedFile@embedfile[]}% } \def\EmbedFile@embedfile[#1]#2{% \ifEmbedFile@finished \EmbedFile@PackageError{% \string\embedfile\space after \string\embedfilefinish }{% The list of embedded files is already written.% }% \else \begingroup \def\EmbedFile@file{#2}% \setkeys{EmbedFile}{#1}% \expandafter\ifx\expandafter\\\pdffilesize{\EmbedFile@file}\\% \EmbedFile@PackageError{% File `\EmbedFile@file' not found% }{% The unknown file is not embedded.% }% \else \EmbedFile@convert\EmbedFile@filespec\EmbedFile@@filespec \ifx\EmbedFile@desc\empty \let\EmbedFile@@desc\empty \else \EmbedFile@convert\EmbedFile@desc\EmbedFile@@desc \fi \immediate\pdfobj stream attr{% /Type/EmbeddedFile% \ifx\EmbedFile@mimetype\empty \else /Subtype/\pdfescapename{\EmbedFile@mimetype}% \fi /Params<<% /ModDate(\pdffilemoddate{\EmbedFile@file})% /Size \pdffilesize{\EmbedFile@file}% /CheckSum<\pdfmdfivesum file{\EmbedFile@file}>% >>% }file{\EmbedFile@file}\relax \immediate\pdfobj{% <<% /Type/Filespec% \ifx\EmbedFile@filesystem\empty \else /FS/\pdfescapename{\EmbedFile@filesystem}% \fi /F(\EmbedFile@@filespec)% \ifx\EmbedFile@@desc\empty \else /Desc(\EmbedFile@@desc)% \fi /EF<<% /F \the\pdflastobj\space 0 R% >>% >>% }% \EmbedFile@add{% \EmbedFile@@filespec }{\the\pdflastobj\space 0 R}% \fi \endgroup \fi } \def\EmbedFile@convert#1#2{% \ifnum\pdfstrcmp{\EmbedFile@stringmethod}{psd}=0 % \pdfstringdef\EmbedFile@temp{#1}% \let#2\EmbedFile@temp \else \edef#2{\pdfescapestring{#1}}% \fi } \global\let\EmbedFile@list\empty \def\EmbedFile@add#1#2{% \begingroup \edef\key{\pdfescapehex{#1}}% \ifx\EmbedFile@list\empty \xdef\EmbedFile@list{\noexpand\do{\key}{#2}}% \else \def\do##1##2{% \ifnum\pdfstrcmp{##1}{\key}>0 % \edef\x{% \toks@{% \the\toks@% \noexpand\do{\key}{#2}% \noexpand\do{##1}{##2}% }% }% \x \def\do####1####2{% \toks@\expandafter{\the\toks@\do{####1}{####2}}% }% \def\stop{% \xdef\EmbedFile@list{\the\toks@}% }% \else \toks@\expandafter{\the\toks@\do{##1}{##2}}% \fi }% \def\stop{% \xdef\EmbedFile@list{\the\toks@\noexpand\do{\key}{#2}}% }% \toks@{}% \EmbedFile@list\stop \fi \endgroup } \newif\ifEmbedFile@finished \def\embedfilefinish{% \ifEmbedFile@finished \EmbedFile@PackageError{% Too many invocations of \string\embedfilefinish }{% The list of embedded files is already written.% }% \else \ifx\EmbedFile@list\empty \else \global\EmbedFile@finishedtrue \begingroup \def\do##1##2{% <##1>##2% }% \immediate\pdfobj{% <<% /Names[\EmbedFile@list]% >>% }% \pdfnames{% /EmbeddedFiles \the\pdflastobj\space 0 R% }% \endgroup \fi \fi } \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname AtEndDocument\endcsname\relax \else \AtEndDocument{\embedfilefinish}% \fi \EmbedFile@AtEnd \endinput %% %% End of file `embedfile.sty'.