texlive[53025] Master: embedfile split from oberdiek (4dec19)
commits+karl at tug.org
commits+karl at tug.org
Wed Dec 4 23:50:22 CET 2019
Revision: 53025
http://tug.org/svn/texlive?view=revision&revision=53025
Author: karl
Date: 2019-12-04 23:50:21 +0100 (Wed, 04 Dec 2019)
Log Message:
-----------
embedfile split from oberdiek (4dec19)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/embedfile/
trunk/Master/texmf-dist/doc/latex/embedfile/README.md
trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-collection.tex
trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-plain.tex
trunk/Master/texmf-dist/doc/latex/embedfile/embedfile.pdf
trunk/Master/texmf-dist/source/latex/embedfile/
trunk/Master/texmf-dist/source/latex/embedfile/embedfile.dtx
trunk/Master/texmf-dist/tex/generic/embedfile/
trunk/Master/texmf-dist/tex/generic/embedfile/embedfile.sty
trunk/Master/texmf-dist/tex/latex/embedfile/
trunk/Master/texmf-dist/tex/latex/embedfile/dtx-attach.sty
trunk/Master/tlpkg/tlpsrc/embedfile.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/embedfile/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/embedfile/README.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/embedfile/README.md 2019-12-04 22:50:21 UTC (rev 53025)
@@ -0,0 +1,7 @@
+# embedfile
+
+embedfile package for LaTeX
+
+
+This package embeds files to a PDF document.
+Currently the only supported drivers are pdfTeX and LuaTeX.
Property changes on: trunk/Master/texmf-dist/doc/latex/embedfile/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-collection.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-collection.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-collection.tex 2019-12-04 22:50:21 UTC (rev 53025)
@@ -0,0 +1,106 @@
+%%
+%% This is file `embedfile-example-collection.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% embedfile.dtx (with options: `examplecollection')
+%%
+%% This is a generated file.
+%%
+%% Project: embedfile
+%% Version: 2019/12/03 v2.9
+%%
+%% Copyright (C)
+%% 2006-2011 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://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".
+%%
+%% The Current Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/embedfile/issues
+%%
+%%
+%% The Base Interpreter refers to any `TeX-Format',
+%% because some files are installed in TDS:tex/generic//.
+%%
+%% 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-example-collection.tex, embedfile-test1.tex,
+%% embedfile-test2.tex, embedfile-test3.tex,
+%% embedfile-test4.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage[bookmarks=false]{hyperref}
+% provides \pdfstringdef that is then used by `title' and
+% other keys.
+\usepackage{embedfile}[2019/12/03]
+\embedfilesetup{
+ view=details,
+ initialfile=embedfile.pdf
+}
+\embedfilefield{file}{
+ type=file,
+ title={File name}
+}
+\embedfilefield{description}{
+ type=desc,
+ title={Description}
+}
+\embedfilefield{date}{
+ type=moddate,
+ title={Date}
+}
+\embedfilefield{size}{
+ type=size,
+ title={Size}
+}
+\embedfilefield{type}{
+ type=text,
+ title={Type},
+ visible=false
+}
+\embedfilesort{
+ type,
+ date=descending
+}
+\begin{document}
+An example for embedded files as collection.
+You need Acrobat Reader 8 or higher.
+
+\embedfile[
+ desc={Source file of package `embedfile'},
+ description.prefix={Package: },
+ type.value={DTX}
+]{embedfile.dtx}
+
+\embedfile[
+ desc={Documentation of package `embedfile'},
+ description.prefix={Package: },
+ type.value={PDF}
+]{embedfile.pdf}
+
+\embedfile[
+ desc={The source for this example},
+ description.prefix={Example: },
+ type.value={TEX}
+]{\jobname.tex}
+
+\end{document}
+\endinput
+%%
+%% End of file `embedfile-example-collection.tex'.
Property changes on: trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-collection.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-plain.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-plain.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-plain.tex 2019-12-04 22:50:21 UTC (rev 53025)
@@ -0,0 +1,81 @@
+%%
+%% This is file `embedfile-example-plain.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% embedfile.dtx (with options: `exampleplain')
+%%
+%% This is a generated file.
+%%
+%% Project: embedfile
+%% Version: 2019/12/03 v2.9
+%%
+%% Copyright (C)
+%% 2006-2011 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://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".
+%%
+%% The Current Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/embedfile/issues
+%%
+%%
+%% The Base Interpreter refers to any `TeX-Format',
+%% because some files are installed in TDS:tex/generic//.
+%%
+%% 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-example-collection.tex, embedfile-test1.tex,
+%% embedfile-test2.tex, embedfile-test3.tex,
+%% embedfile-test4.tex.
+%%
+% Load packages
+\input miniltx
+% \def\Gin at driver{pdftex.def}
+% \input graphicx.sty
+\input embedfile.sty
+\resetatcatcode
+
+% default setting
+\embedfilesetup{
+ mimetype=text/plain
+}
+
+% Embed files
+\embedfile[
+ filespec=example.tex,
+ desc={Source code (plain-TeX) of this example}
+]{embedfile-example-plain.tex}
+
+\embedfile[
+ desc={Source of package `embedfile'}
+]{embedfile.dtx}
+
+\embedfile[
+ mimetype=application/pdf,
+ desc={Documentation of package `embedfile'}
+]{embedfile.pdf}
+
+% Some text
+This example document contains three embedded files.
+
+% End of document
+\embedfilefinish % don't forget
+\bye
+\endinput
+%%
+%% End of file `embedfile-example-plain.tex'.
Property changes on: trunk/Master/texmf-dist/doc/latex/embedfile/embedfile-example-plain.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/embedfile/embedfile.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/embedfile/embedfile.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/embedfile/embedfile.pdf 2019-12-04 22:49:34 UTC (rev 53024)
+++ trunk/Master/texmf-dist/doc/latex/embedfile/embedfile.pdf 2019-12-04 22:50:21 UTC (rev 53025)
Property changes on: trunk/Master/texmf-dist/doc/latex/embedfile/embedfile.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/embedfile/embedfile.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/embedfile/embedfile.dtx (rev 0)
+++ trunk/Master/texmf-dist/source/latex/embedfile/embedfile.dtx 2019-12-04 22:50:21 UTC (rev 53025)
@@ -0,0 +1,1965 @@
+% \iffalse meta-comment
+%
+% File: embedfile.dtx
+% Version: 2019/12/03 v2.9
+% Info: Embed files into PDF
+%
+% Copyright (C)
+% 2006-2011 Heiko Oberdiek
+% 2016-2019 Oberdiek Package Support Group
+% https://github.com/ho-tex/embedfile/issues
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any later
+% version. This version of this license is in
+% https://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% https://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".
+%
+% The Current Maintainers of this work are
+% Heiko Oberdiek and the Oberdiek Package Support Group
+% https://github.com/ho-tex/embedfile/issues
+%
+% The Base Interpreter refers to any `TeX-Format',
+% because some files are installed in TDS:tex/generic//.
+%
+% 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-example-collection.tex, embedfile-test1.tex,
+% embedfile-test2.tex, embedfile-test3.tex,
+% embedfile-test4.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/embedfile/embedfile.dtx
+% CTAN:macros/latex/contrib/embedfile/embedfile.pdf
+%
+% Unpacking:
+% (a) If embedfile.ins is present:
+% tex embedfile.ins
+% (b) Without embedfile.ins:
+% tex embedfile.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{embedfile.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If embedfile.drv is present:
+% latex embedfile.drv
+% (b) Without embedfile.drv:
+% latex embedfile.dtx; ...
+% The class ltxdoc loads the configuration file ltxdoc.cfg
+% if available. Here you can specify further options, e.g.
+% use A4 as paper format:
+% \PassOptionsToClass{a4paper}{article}
+%
+% Programm calls to get the documentation (example):
+% pdflatex embedfile.dtx
+% makeindex -s gind.ist embedfile.idx
+% pdflatex embedfile.dtx
+% makeindex -s gind.ist embedfile.idx
+% pdflatex embedfile.dtx
+%
+% Installation:
+% TDS:tex/generic/embedfile/embedfile.sty
+% TDS:tex/generic/embedfile/dtx-attach.sty
+% TDS:doc/latex/embedfile/embedfile.pdf
+% TDS:doc/latex/embedfile/embedfile-example-plain.tex
+% TDS:doc/latex/embedfile/embedfile-example-collection.tex
+% TDS:source/latex/embedfile/embedfile.dtx
+%
+%<*ignore>
+\begingroup
+ \catcode123=1 %
+ \catcode125=2 %
+ \def\x{LaTeX2e}%
+\expandafter\endgroup
+\ifcase 0\ifx\install y1\fi\expandafter
+ \ifx\csname processbatchFile\endcsname\relax\else1\fi
+ \ifx\fmtname\x\else 1\fi\relax
+\else\csname fi\endcsname
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: embedfile 2019/12/03 v2.9 Embed files into PDF (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: embedfile
+Version: 2019/12/03 v2.9
+
+Copyright (C)
+ 2006-2011 Heiko Oberdiek
+ 2016-2019 Oberdiek Package Support Group
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either
+version 1.3c of this license or (at your option) any later
+version. This version of this license is in
+ https://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ https://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".
+
+The Current Maintainers of this work are
+Heiko Oberdiek and the Oberdiek Package Support Group
+https://github.com/ho-tex/embedfile/issues
+
+
+The Base Interpreter refers to any `TeX-Format',
+because some files are installed in TDS:tex/generic//.
+
+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-example-collection.tex, embedfile-test1.tex,
+ embedfile-test2.tex, embedfile-test3.tex,
+ embedfile-test4.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{embedfile.ins}{\from{embedfile.dtx}{install}}%
+ \file{embedfile.drv}{\from{embedfile.dtx}{driver}}%
+ \usedir{tex/generic/embedfile}%
+ \file{embedfile.sty}{\from{embedfile.dtx}{package}}%
+ \usedir{tex/latex/embedfile}%
+ \file{dtx-attach.sty}{\from{embedfile.dtx}{dtxattach}}%
+ \usedir{doc/latex/embedfile}%
+ \file{embedfile-example-plain.tex}{\from{embedfile.dtx}{exampleplain}}%
+ \file{embedfile-example-collection.tex}{\from{embedfile.dtx}{examplecollection}}%
+% \usedir{doc/latex/embedfile/test}%
+% \file{embedfile-test1.tex}{\from{embedfile.dtx}{test1}}%
+% \file{embedfile-test2.tex}{\from{embedfile.dtx}{test2}}%
+% \file{embedfile-test3.tex}{\from{embedfile.dtx}{test3}}%
+% \file{embedfile-test4.tex}{\from{embedfile.dtx}{test4}}%
+}
+
+\catcode32=13\relax% active space
+\let =\space%
+\Msg{************************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* embedfile.sty, dtx-attach.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `embedfile.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{embedfile.drv}%
+ [2019/12/03 v2.9 Embed files into PDF (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{embedfile.dtx}%
+\end{document}
+%</driver>
+% \fi
+%
+%
+%
+% \GetFileInfo{embedfile.drv}
+%
+% \title{The \xpackage{embedfile} package}
+% \date{2019/12/03 v2.9}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at \url{https://github.com/ho-tex/embedfile/issues}}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package embeds files to a PDF document.
+% Currently the only supported driver is \pdfTeX\ $>=$ 1.30 in PDF mode.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% The PDF format (\cite{pdfspec}) allows the inclusion of files
+% inside the PDF document. The included files can be bound to an
+% annotation on a page. Or they can be recorded in a sorted
+% list of embedded files. The packages \xpackage{attachfile}
+% or \xpackage{attachfile2} follow the first approach, this
+% package uses the latter method.
+%
+% \subsubsection{Future development}
+%
+% My dream is a large package that merges the features of
+% all these packages meantioned before:
+% \begin{itemize}
+% \item Files can be attached to a page.
+% \item Files can be attached to the document.
+% \item An easy user interface for simple, common tasks and
+% beginners.
+% \item An interface for the advanced users that want to setup
+% every detail.
+% \item Support of many drivers (pdftex, dvips, dvipdfm, \dots).
+% \item \dots
+% \end{itemize}
+% However, I have not managed to take the time for this project.
+% Instead:
+% \begin{itemize}
+% \item First I experimented with package \xpackage{attachfile},
+% adding driver support, fixing bugs, \dots. The result is
+% currently named as \xpackage{attachfile2}. It uses an external
+% script to get file properties (size, date, checksum, \dots).
+% \item In order to avoid an external program for getting basic
+% file properties I provided a patch ``EscapeAndOther'' for
+% pdfTeX that was accepted for version 1.30.
+% \item This package closes a gap left by the packages for attaching
+% files and allows the embedding of files to the document.
+% Also it makes use of the new primitives of \pdfTeX.
+% \end{itemize}
+%
+% \subsection{User interface}
+%
+% This package \xpackage{embedfile} can be used with both
+% \LaTeX\ and \plainTeX. See \autoref{sec:plain} that
+% explains the use with \plainTeX\ by an example.
+% In \LaTeX\ the package is loaded as usually. There are no options.
+% \begin{quote}
+% \verb|\usepackage{embedfile}|
+% \end{quote}
+%
+% \begin{declcs}{embedfile}
+% |[|\meta{options}|]| \M{file}
+% \end{declcs}
+% The macro \cs{embedfile} includes file \meta{file} and
+% attaches it to the PDF document. At the end of the document
+% the sorted list of embedded files are written. Thus you can
+% safely use \cs{embedfile} before \verb|\end{document}|.
+% Embedding files using \cs{AtEndDocument} will only work,
+% if \cs{AtEndDocument} is called before loading the package
+% \xpackage{embedfile}.
+%
+% The \meta{options} are give as key value pairs. The following
+% keys are supported:
+% \begin{description}
+% \item[\xoption{filespec}]
+% This allows to override the file name
+% that appears in the PDF file. If you are using other than
+% simple file names (8-bit, path separators, \dots), look into
+% the PDF specification (\cite{pdfspec}).
+% There are rules how these file names must be written/encoded.
+% Avoid 8-bit characters
+% and other special characters, the behaviour is currently undefined.
+% Use option \xoption{ucfilespec} for more funny file names.
+% The string method, see below, is |escape| since version 2.4.
+%
+% This name is also used as entry in a name tree
+% (see PDF specification: |/EmbeddedFiles|). Therefore the
+% value for \xoption{filespec} must be unique among all
+% embedded files. Also key \xoption{initialfiles} refers
+% to this name, if the file name and the value of \xoption{filespec}
+% are different.
+% \item[\xoption{ucfilespec}]
+% Since PDF 1.7 the file name may be provided in Unicode.
+% The conversion of the option value into a PDF string
+% is controlled by option \xoption{stringmethod}.
+% \item[\xoption{filesystem}]
+% This sets the entry \verb|/FS| in
+% the file specification dictionary, see PDF specification
+% (\cite{pdfspec}).
+% Example: \verb|filesystem=URL|.
+% \item[\xoption{mimetype}]
+% This sets the mime type (\cite{mime}) of the file,
+% see \autoref{sec:plain} for examples and \cite{types}
+% for a list of officially registered types.
+% \item[\xoption{desc}]
+% The description for the file.
+% \item[\xoption{stringmethod}]
+% The package must convert the values of the keys \xoption{ucfilespec}
+% and \xoption{desc} into a PDF string (before version 2.4: \xoption{filespec}
+% and \xoption{desc}). If \xpackage{hyperref}
+% is found, then its \cs{pdfstringdef} will be used, otherwise
+% \pdfTeX's \cs{pdfescapestring} is used. Value \verb|psd|
+% forces the use of \cs{pdfstringdef}, value \verb|escape|
+% the use of \cs{pdfescapestring}.
+% \item[\xoption{\meta{key}.value}] Sets the value of a collection
+% item property, see section \ref{sec:collection}.
+% \item[\xoption{\meta{key}.prefix}]
+% Sets the prefix of a collection item property,
+% see section \ref{sec:collection}.
+% \item[\xoption{id}]
+% The value must be an unique name. Macros
+% \cs{embedfileifobjectexists} and \cs{embedfilegetobject}
+% are using this name later.
+% \end{description}
+%
+% \begin{declcs}{embedfilefinish}
+% \end{declcs}
+% The list of all embedded files must be added as data structure
+% in the PDF file. In case of \LaTeX\ this is automatically done.
+% The package uses \cs{AtEndDocument}. Then the list of all
+% files should be known. However, \plainTeX\ does not know
+% about \cs{AtEndDocument}. Thus the user must call
+% \cs{embedfilefinish} at the end of the document
+% after the last file is embedded.
+%
+% \begin{declcs}{embedfilesetup} \M{options}
+% \end{declcs}
+% Options for \cs{embedfile} and collection support
+% can be set in \cs{embedfilesetup}.
+%
+% \subsection{Collection support (PDF 1.7)}
+% \label{sec:collection}
+%
+% Since PDF 1.7 the embedded files can form a \emph{collection}
+% (sometimes referred as \emph{package}), the main document
+% is called \emph{cover sheet}. See PDF specification
+% 8.2.4 ``Collections'' and 3.10.5 ``Collection items'' \cite{pdfspec}.
+%
+% Usually Acrobat Reader 7 or 8 shows the
+% embedded files in a table at the bottom with the following columns:
+% \begin{quote}
+% \begin{tabular}{@{}l|l|l|l@{}}
+% Name & Description & Modified & Size\\
+% \hline
+% \dots & \dots & \dots & \dots\\
+% \end{tabular}
+% \end{quote}
+% Acrobat Reader 10 shows the embeded files in the left panel
+% and adds a new column for the compressed size.
+%
+% If the files form a collection, then they are displayed
+% in a table left or top (depending on option \xoption{view},
+% see \cs{embedfilesetup}).
+%
+%
+% Collection support is enabled automatically, if
+% it is used.
+%
+% \begin{declcs}{embedfilesetup} \M{options}
+% \end{declcs}
+% The following options are supported in addition
+% to options for \cs{embedfile}:
+% \begin{description}
+% \item[\xoption{view}]
+% If the PDF file contains a collection, then Acrobat Reader 8
+% shows a line at the top below the menu bar and the toolbar.
+% It shows the current selected file, icons for changing the
+% view mode, an options menu.
+% The initial mode how the collection is presented is
+% set by this option \xoption{view}.
+% The following modes/values are supported, the default is |details|:
+% \begin{description}
+% \item[\texttt{details}] The full collection table is displayed
+% at the top below the collection bar.
+% \item[\texttt{tile}] The files of the collection are shown
+% in tile mode on the left.
+% \item[\texttt{hidden}] The collection table is not shown.
+% \end{description}
+% \item[\xoption{initialfile}]
+% Selects the file that is initially presented. Especially
+% useful for an embedded PDF file that is then shown instead
+% of the cover document. There must be an \cs{embedfile} command
+% somewhere whose value for key \xoption{filespec} is used here.
+% The \cs{embedfile} command can drop option \xoption{filespec}
+% if the file name is not different.
+% \end{description}
+%
+% \begin{declcs}{embedfilefield} \M{key} \M{options}
+% \end{declcs}
+% Macro \cs{embedfilefield} defines a column/field in the collection table.
+% The name of the field is \meta{key}.
+% \begin{description}
+% \item[\xoption{type}]
+% sets the type of the field. The supported values are:
+% \begin{description}
+% \item[\texttt{text}] A text field. Its value is set in
+% \cs{embedfile} by option \xoption{\meta{key}.value}.
+% \item[\texttt{date}] A date field. Its value is set in
+% \cs{embedfile} by option \xoption{\meta{key}.value}.
+% A special format is required, see ``3.8.3 Dates'' \cite{pdfspec}.
+% \item[\texttt{number}] A field with an integer or float number.
+% Its value is set in \cs{embedfile} by option
+% \xoption{\meta{key}.value}.
+% \item[\texttt{file}] The file name of the embedded file.
+% \item[\texttt{desc}] The description text of the embedded file. It is
+% set in \cs{embedfile} by option \xoption{desc}.
+% \item[\texttt{moddate}] The modification date of the embedded file.
+% \item[\texttt{size}] The size of the embedded file.
+% \end{description}
+% All types allow the use of a prefix that is disregarded by
+% sorting. The prefix for this field is set in \cs{embedfile} by
+% option \xoption{\meta{key}.prefix}.
+% \item[\xoption{title}] sets the column title.
+% \item[\xoption{visible}] controls whether the column is presented:
+% \begin{description}
+% \item[\texttt{true}] shows the column.
+% \item[\texttt{false}] hides the column.
+% \end{description}
+% Default: \texttt{true}
+% \item[\xoption{edit}]
+% Allows the editing of field values. Does not seem to have an
+% effect for Acrobat Reader.
+% \begin{description}
+% \item[\texttt{true}] enables the feature, if available (depends
+% on the PDF viewer).
+% \item[\texttt{false}] disables the feature.
+% \end{description}
+% Default: \texttt{false}
+% \end{description}
+% The order of \cs{embedfilefield} statements defines the order
+% of the columns.
+%
+% \begin{declcs}{embedfilesort} \M{key-sort-list}
+% \end{declcs}
+% The sort order of the embedded files are controlled by
+% macro \cs{embedfilesort}. \meta{key-sort-list} defines
+% the sort order. The key is a field name defined by \cs{embedfilefield}.
+% Its value is either \texttt{ascending} or \texttt{descending}.
+% The default is \texttt{ascending}.
+%
+% \subsection{Export of object references}
+%
+% Caution: This feature is still experimental. It may be even removed
+% in future versions. Therefore feedback would be nice, if someone
+% has a useful application for this feature.
+%
+% Object numbers are saved, if \xoption{id} is given in \cs{embedfile}.
+% The following objects are supported:
+% \begin{itemize}
+% \item \texttt{EmbeddedFile}
+% \item \texttt{Filespec}
+% \end{itemize}
+%
+% \begin{declcs}{embedfileifobjectexists} \M{id} \M{type}
+% \M{then} \M{else}
+% \end{declcs}
+% Macro \cs{embedfileifobjectexists} tests whether object of \meta{type}
+% is available for the embedded file identified by \meta{id}.
+%
+% \begin{declcs}{embedfilegetobject} \M{id} \M{type}
+% \end{declcs}
+% Macro \cs{embedfilegetobject} expands to the full object reference
+% object of \meta{type} for the embedded file identified by \meta{id}.
+%
+% \subsubsection{Example}
+%
+%\begin{quote}
+%\begin{verbatim}
+%\embedfile[id={foo}]{foo.pdf}
+%\embedfileifobjectexists{foo}{Filespec}{%
+% \typeout{%
+% FileSpec object for `foo': %
+% \embedfilegetobject{foo}{Filespec}%
+% }%
+%}{%
+% \typeout{No Filespec object for `foo'}%
+%}
+%\end{verbatim}
+%\end{quote}
+%
+% \subsection{Examples}
+% \label{sec:examples}
+%
+% \subsubsection{\plainTeX}
+% \label{sec:plain}
+%
+% The package can be used with \plainTeX. It can be used
+% with or without help from \xfile{miniltx.tex}.
+%
+% If additionally package \xpackage{keyval} (\xpackage{graphicx})
+% is needed, load it first. Then package \xpackage{embedfile} avoids
+% a duplicate loading of package \xpackage{keyval}.
+%
+% Because \plainTeX\ does not provide a hook at end of the document,
+% you have to call \cs{embedfilefinish} manually at the end
+% after the last embedded file.
+% \begin{macrocode}
+%<*exampleplain>
+%<<END
+% Load packages
+\input miniltx
+% \def\Gin at driver{pdftex.def}
+% \input graphicx.sty
+\input embedfile.sty
+\resetatcatcode
+
+% default setting
+\embedfilesetup{
+ mimetype=text/plain
+}
+
+% Embed files
+\embedfile[
+ filespec=example.tex,
+ desc={Source code (plain-TeX) of this example}
+]{embedfile-example-plain.tex}
+
+\embedfile[
+ desc={Source of package `embedfile'}
+]{embedfile.dtx}
+
+\embedfile[
+ mimetype=application/pdf,
+ desc={Documentation of package `embedfile'}
+]{embedfile.pdf}
+
+% Some text
+This example document contains three embedded files.
+
+% End of document
+\embedfilefinish % don't forget
+\bye
+%END
+%</exampleplain>
+% \end{macrocode}
+%
+% \subsubsection{Collection example}
+%
+% \begin{macrocode}
+%<*examplecollection>
+%<<END
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage[bookmarks=false]{hyperref}
+% provides \pdfstringdef that is then used by `title' and
+% other keys.
+\usepackage{embedfile}[2019/12/03]
+\embedfilesetup{
+ view=details,
+ initialfile=embedfile.pdf
+}
+\embedfilefield{file}{
+ type=file,
+ title={File name}
+}
+\embedfilefield{description}{
+ type=desc,
+ title={Description}
+}
+\embedfilefield{date}{
+ type=moddate,
+ title={Date}
+}
+\embedfilefield{size}{
+ type=size,
+ title={Size}
+}
+\embedfilefield{type}{
+ type=text,
+ title={Type},
+ visible=false
+}
+\embedfilesort{
+ type,
+ date=descending
+}
+\begin{document}
+An example for embedded files as collection.
+You need Acrobat Reader 8 or higher.
+
+\embedfile[
+ desc={Source file of package `embedfile'},
+ description.prefix={Package: },
+ type.value={DTX}
+]{embedfile.dtx}
+
+\embedfile[
+ desc={Documentation of package `embedfile'},
+ description.prefix={Package: },
+ type.value={PDF}
+]{embedfile.pdf}
+
+\embedfile[
+ desc={The source for this example},
+ description.prefix={Example: },
+ type.value={TEX}
+]{\jobname.tex}
+
+\end{document}
+%END
+%</examplecollection>
+% \end{macrocode}
+%
+% \subsection{Package \xpackage{dtx-attach}}
+%
+% Package \xpackage{dtx-attach} is just a small application of
+% package \xpackage{embedfile}. I am using it for the CTAN
+% documentation of my packages in \CTANpkg{oberdiek}.
+% It also serves as small example for the use of the package with \LaTeX.
+%
+% \begin{macrocode}
+%<*dtxattach>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{dtx-attach}
+ [2019/12/03 v2.9 Embed \string\jobname.dtx (HO)]%
+\RequirePackage{embedfile}[2019/12/03]
+\embedfile[%
+ stringmethod=escape,%
+ mimetype=plain/text,%
+ desc={LaTeX docstrip source archive for package `\jobname'}%
+]{\jobname.dtx}
+%</dtxattach>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Reload check and package identification}
+% Reload check, especially if the package is not used with \LaTeX.
+% \begin{macrocode}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode35=6 % #
+ \catcode39=12 % '
+ \catcode44=12 % ,
+ \catcode45=12 % -
+ \catcode46=12 % .
+ \catcode58=12 % :
+ \catcode64=11 % @
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \expandafter\let\expandafter\x\csname ver at embedfile.sty\endcsname
+ \ifx\x\relax % plain-TeX, first loading
+ \else
+ \def\empty{}%
+ \ifx\x\empty % LaTeX, first loading,
+ % variable is initialized, but \ProvidesPackage not yet seen
+ \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}%
+ \aftergroup\endinput
+ \fi
+ \fi
+\endgroup%
+% \end{macrocode}
+% Package identification:
+% \begin{macrocode}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode35=6 % #
+ \catcode39=12 % '
+ \catcode40=12 % (
+ \catcode41=12 % )
+ \catcode44=12 % ,
+ \catcode45=12 % -
+ \catcode46=12 % .
+ \catcode47=12 % /
+ \catcode58=12 % :
+ \catcode64=11 % @
+ \catcode91=12 % [
+ \catcode93=12 % ]
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \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\@undefined
+ \xdef#1{#3}%
+ \fi
+ \ifx#1\relax
+ \xdef#1{#3}%
+ \fi
+ }%
+ \fi
+\expandafter\x\csname ver at embedfile.sty\endcsname
+\ProvidesPackage{embedfile}%
+ [2019/12/03 v2.9 Embed files into PDF (HO)]%
+% \end{macrocode}
+%
+% \subsection{Catcodes}
+%
+% \begin{macrocode}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \catcode64=11 % @
+ \def\x{\endgroup
+ \expandafter\edef\csname EmFi at AtEnd\endcsname{%
+ \endlinechar=\the\endlinechar\relax
+ \catcode13=\the\catcode13\relax
+ \catcode32=\the\catcode32\relax
+ \catcode35=\the\catcode35\relax
+ \catcode61=\the\catcode61\relax
+ \catcode64=\the\catcode64\relax
+ \catcode123=\the\catcode123\relax
+ \catcode125=\the\catcode125\relax
+ }%
+ }%
+\x\catcode61\catcode48\catcode32=10\relax%
+\catcode13=5 % ^^M
+\endlinechar=13 %
+\catcode35=6 % #
+\catcode64=11 % @
+\catcode123=1 % {
+\catcode125=2 % }
+\def\TMP at EnsureCode#1#2{%
+ \edef\EmFi at AtEnd{%
+ \EmFi at AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP at EnsureCode{39}{12}% '
+\TMP at EnsureCode{40}{12}% (
+\TMP at EnsureCode{41}{12}% )
+\TMP at EnsureCode{44}{12}% ,
+\TMP at EnsureCode{46}{12}% .
+\TMP at EnsureCode{47}{12}% /
+\TMP at EnsureCode{58}{12}% :
+\TMP at EnsureCode{60}{12}% <
+\TMP at EnsureCode{62}{12}% >
+\TMP at EnsureCode{91}{12}% [
+\TMP at EnsureCode{93}{12}% ]
+\TMP at EnsureCode{96}{12}% `
+\edef\EmFi at AtEnd{\EmFi at AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Tools}
+%
+% \begin{macro}{\EmFi at RequirePackage}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \def\EmFi at RequirePackage#1[#2]{%
+ \input #1.sty\relax
+ }%
+\else
+ \let\EmFi at RequirePackage\RequirePackage
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EmFi at Error}
+% \begin{macrocode}
+\EmFi at RequirePackage{infwarerr}[2007/09/09]%
+\def\EmFi at Error{%
+ \@PackageError{embedfile}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Luatex compat
+% \begin{macrocode}
+\ifx\pdfextension\@undefined\else
+ \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax}
+ \protected\def\pdfnames {\pdfextension names }
+ \protected\def\pdfobj {\pdfextension obj }
+ \protected\def\pdfcatalog {\pdfextension catalog }
+ \let\pdfoutput \outputmode
+\fi
+% \end{macrocode}
+%
+% \subsection{Check for recent \pdfTeX\ in PDF mode}
+%
+% Load package \xpackage{iftex} and check mode.
+% \begin{macrocode}
+\EmFi at RequirePackage{iftex}[2019/11/07]
+\ifpdf
+\else
+ \EmFi at Error{%
+ Missing pdfTeX in PDF mode%
+ }{%
+ Currently other drivers are not supported. %
+ Package loading is aborted.%
+ }%
+ \expandafter\EmFi at AtEnd
+\fi%
+% \end{macrocode}
+% \begin{macrocode}
+\EmFi at RequirePackage{pdftexcmds}[2007/11/11]
+\EmFi at RequirePackage{ltxcmds}[2010/03/01]
+\EmFi at RequirePackage{kvsetkeys}[2010/03/01]
+\EmFi at RequirePackage{kvdefinekeys}[2010/03/01]
+% \end{macrocode}
+% Check version.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf at filesize\endcsname\relax
+ \EmFi at Error{%
+ Unsupported pdfTeX version%
+ }{%
+ At least version 1.30 is necessary. Package loading is aborted.%
+ }%
+ \expandafter\EmFi at AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Strings}
+%
+% Minimal version of package \xpackage{pdfescape} is 2007/08/27 v1.5
+% because of \cs{EdefSanitize}.
+% \begin{macrocode}
+\EmFi at RequirePackage{pdfescape}[2007/11/11]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\EmFi at temp#1{%
+ \expandafter\EdefSanitize\csname EmFi at S@#1\endcsname{#1}%
+}
+% \end{macrocode}
+% \begin{macro}{\EmFi at details}
+% \begin{macrocode}
+\EmFi at temp{details}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at tile}
+% \begin{macrocode}
+\EmFi at temp{tile}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at hidden}
+% \begin{macrocode}
+\EmFi at temp{hidden}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@text}
+% \begin{macrocode}
+\EmFi at temp{text}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@date}
+% \begin{macrocode}
+\EmFi at temp{date}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@number}
+% \begin{macrocode}
+\EmFi at temp{number}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@file}
+% \begin{macrocode}
+\EmFi at temp{file}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@desc}
+% \begin{macrocode}
+\EmFi at temp{desc}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@afrelationship}
+% \begin{macrocode}
+\EmFi at temp{afrelationship}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@moddate}
+% \begin{macrocode}
+\EmFi at temp{moddate}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@creationdate}
+% \begin{macrocode}
+\EmFi at temp{creationdate}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@size}
+% \begin{macrocode}
+\EmFi at temp{size}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@ascending}
+% \begin{macrocode}
+\EmFi at temp{ascending}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@descending}
+% \begin{macrocode}
+\EmFi at temp{descending}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@true}
+% \begin{macrocode}
+\EmFi at temp{true}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at S@false}
+% \begin{macrocode}
+\EmFi at temp{false}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Switches}
+%
+% \begin{macro}{\ifEmFi at collection}
+% \begin{macrocode}
+\ltx at newif\ifEmFi at collection
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi at sort}
+% \begin{macrocode}
+\ltx at newif\ifEmFi at sort
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi at visible}
+% \begin{macrocode}
+\ltx at newif\ifEmFi at visible
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi at edit}
+% \begin{macrocode}
+\ltx at newif\ifEmFi at edit
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi at item}
+% \begin{macrocode}
+\ltx at newif\ifEmFi at item
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi at finished}
+% \begin{macrocode}
+\ltx at newif\ifEmFi at finished
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi at id}
+% \begin{macrocode}
+\ltx at newif\ifEmFi at id
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Key value definitions}
+%
+% \begin{macro}{\EmFi at GlobalKey}
+% \begin{macrocode}
+\def\EmFi at GlobalKey#1#2{%
+ \global\expandafter\let\csname KV@#1@#2\expandafter\endcsname
+ \csname KV@#1@#2\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at GlobalDefaultKey}
+% \begin{macrocode}
+\def\EmFi at GlobalDefaultKey#1#2{%
+ \EmFi at GlobalKey{#1}{#2}%
+ \global\expandafter\let
+ \csname KV@#1@#2 at default\expandafter\endcsname
+ \csname KV@#1@#2 at default\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EmFi at DefineKey}
+% \begin{macrocode}
+\def\EmFi at DefineKey#1#2{%
+ \kv at define@key{EmFi}{#1}{%
+ \expandafter\def\csname EmFi@#1\endcsname{##1}%
+ }%
+ \expandafter\def\csname EmFi@#1\endcsname{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% Subtype of the embedded file (optional).
+% \begin{macrocode}
+\EmFi at DefineKey{mimetype}{}
+% \end{macrocode}
+% File specification string.
+% \begin{macrocode}
+\EmFi at DefineKey{filespec}{\EmFi at file}
+% \end{macrocode}
+% File specification string in Unicode.
+% \begin{macrocode}
+\EmFi at DefineKey{ucfilespec}{}
+% \end{macrocode}
+% File system (optional).
+% \begin{macrocode}
+\EmFi at DefineKey{filesystem}{}
+% \end{macrocode}
+% Description (optional).
+% \begin{macrocode}
+\EmFi at DefineKey{desc}{}
+% \end{macrocode}
+% AFRelationship (mandatory for PDF/A-3 compliance).
+% \begin{macrocode}
+\EmFi at DefineKey{afrelationship}{}
+% \end{macrocode}
+% Method for converting text to PDF strings.
+% \begin{macrocode}
+\EmFi at DefineKey{stringmethod}{%
+ \ifx\pdfstringdef\@undefined
+ escape%
+ \else
+ \ifx\pdfstringdef\relax
+ escape%
+ \else
+ psd%
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% Option \xoption{id} as key for object numbers.
+% \begin{macrocode}
+\kv at define@key{EmFi}{id}{%
+ \def\EmFi at id{#1}%
+ \EmFi at idtrue
+}
+% \end{macrocode}
+% \begin{macro}{\EmFi at defobj}
+% \begin{macrocode}
+\def\EmFi at defobj#1{%
+ \ifEmFi at id
+ \expandafter\xdef\csname EmFi@#1@\EmFi at id\endcsname{%
+ \the\pdflastobj\ltx at space 0 R%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfileifobjectexists}
+% \begin{macrocode}
+\def\embedfileifobjectexists#1#2{%
+ \expandafter\ifx\csname EmFi@#2@#1\endcsname\relax
+ \expandafter\ltx at secondoftwo
+ \else
+ \expandafter\ltx at firstoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfilegetobject}
+% \begin{macrocode}
+\def\embedfilegetobject#1#2{%
+ \embedfileifobjectexists{#1}{#2}{%
+ \csname EmFi@#2@#1\endcsname
+ }{%
+ 0 0 R%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Initial view of the collection.
+% \begin{macrocode}
+\kv at define@key{EmFi}{view}[]{%
+ \EdefSanitize\EmFi at temp{#1}%
+ \def\EmFi at next{%
+ \global\EmFi at collectiontrue
+ }%
+ \ifx\EmFi at temp\ltx at empty
+ \let\EmFi at view\EmFi at S@details
+ \else\ifx\EmFi at temp\EmFi at S@details
+ \let\EmFi at view\EmFi at S@details
+ \else\ifx\EmFi at temp\EmFi at S@tile
+ \let\EmFi at view\EmFi at S@tile
+ \else\ifx\EmFi at temp\EmFi at S@hidden
+ \let\EmFi at view\EmFi at S@hidden
+ \else
+ \let\EmFi at next\relax
+ \EmFi at Error{%
+ Unknown value `\EmFi at temp' for key `view'.\MessageBreak
+ Supported values: `details', `tile', `hidden'.%
+ }\@ehc
+ \fi\fi\fi\fi
+ \EmFi at next
+}
+% \end{macrocode}
+% \begin{macrocode}
+\EmFi at DefineKey{initialfile}{}
+% \end{macrocode}
+%
+% \begin{macro}{\embedfilesetup}
+% \begin{macrocode}
+\def\embedfilesetup{%
+ \ifEmFi at finished
+ \def\EmFi at next##1{}%
+ \EmFi at Error{%
+ \string\embedfilefield\ltx at space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \def\EmFi at next{%
+ \kvsetkeys{EmFi}%
+ }%
+ \fi
+ \EmFi at next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EmFi at schema}
+% \begin{macrocode}
+\def\EmFi at schema{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at order}
+% \begin{macrocode}
+\gdef\EmFi at order{0}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@@order}
+% \begin{macrocode}
+\let\EmFi@@order\relax
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at fieldlist}
+% \begin{macrocode}
+\def\EmFi at fieldlist{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at sortcase}
+% \begin{macrocode}
+\def\EmFi at sortcase{0}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfilefield}
+% \begin{macrocode}
+\def\embedfilefield#1#2{%
+ \ifEmFi at finished
+ \EmFi at Error{%
+ \string\embedfilefield\ltx at space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \global\EmFi at collectiontrue
+ \EdefSanitize\EmFi at key{#1}%
+ \expandafter\ifx\csname KV at EmFi@\EmFi at key.prefix\endcsname\relax
+ \begingroup
+ \count@=\EmFi at order
+ \advance\count@ 1 %
+ \xdef\EmFi at order{\the\count@}%
+ \let\EmFi at title\EmFi at key
+ \let\EmFi at type\EmFi at S@text
+ \EmFi at visibletrue
+ \EmFi at editfalse
+ \kvsetkeys{EmFiFi}{#2}%
+ \EmFi at convert\EmFi at title\EmFi at title
+ \xdef\EmFi at schema{%
+ \EmFi at schema
+ /\pdf at escapename{\EmFi at key}<<%
+ /Subtype/%
+ \ifx\EmFi at type\EmFi at S@date D%
+ \else\ifx\EmFi at type\EmFi at S@number N%
+ \else\ifx\EmFi at type\EmFi at S@file F%
+ \else\ifx\EmFi at type\EmFi at S@desc Desc%
+ \else\ifx\EmFi at type\EmFi at S@afrelationship AFRelationship%
+ \else\ifx\EmFi at type\EmFi at S@moddate ModDate%
+ \else\ifx\EmFi at type\EmFi at S@creationdate CreationDate%
+ \else\ifx\EmFi at type\EmFi at S@size Size%
+ \else S%
+ \fi\fi\fi\fi\fi\fi\fi
+ /N(\EmFi at title)%
+ \EmFi@@order{\EmFi at order}%
+ \ifEmFi at visible
+ \else
+ /V false%
+ \fi
+ \ifEmFi at edit
+ /E true%
+ \fi
+ >>%
+ }%
+ \let\do\relax
+ \xdef\EmFi at fieldlist{%
+ \EmFi at fieldlist
+ \do{\EmFi at key}%
+ }%
+ \ifx\EmFi at type\EmFi at S@text
+ \kv at define@key{EmFi}{\EmFi at key.value}{%
+ \EmFi at itemtrue
+ \def\EmFi at temp{##1}%
+ \EmFi at convert\EmFi at temp\EmFi at temp
+ \expandafter\def\csname EmFi at V@#1%
+ \expandafter\endcsname\expandafter{%
+ \expandafter(\EmFi at temp)%
+ }%
+ }%
+ \EmFi at GlobalKey{EmFi}{\EmFi at key.value}%
+ \else\ifx\EmFi at type\EmFi at S@date
+ \kv at define@key{EmFi}{\EmFi at key.value}{%
+ \EmFi at itemtrue
+ \def\EmFi at temp{##1}%
+ \EmFi at convert\EmFi at temp\EmFi at temp
+ \expandafter\def\csname EmFi at V@#1%
+ \expandafter\endcsname\expandafter{%
+ \expandafter(\EmFi at temp)%
+ }%
+ }%
+ \EmFi at GlobalKey{EmFi}{\EmFi at key.value}%
+ \else\ifx\EmFi at type\EmFi at S@number
+ \kv at define@key{EmFi}{\EmFi at key.value}{%
+ \EmFi at itemtrue
+ \expandafter\EdefSanitize\csname EmFi at V@#1\endcsname{ ##1}%
+ }%
+ \EmFi at GlobalKey{EmFi}{\EmFi at key.value}%
+ \fi\fi\fi
+ \kv at define@key{EmFi}{\EmFi at key.prefix}{%
+ \EmFi at itemtrue
+ \expandafter\def\csname EmFi at P@#1\endcsname{##1}%
+ }%
+ \EmFi at GlobalKey{EmFi}{\EmFi at key.prefix}%
+ \kv at define@key{EmFiSo}{\EmFi at key}[ascending]{%
+ \EdefSanitize\EmFi at temp{##1}%
+ \ifx\EmFi at temp\EmFi at S@ascending
+ \def\EmFi at temp{true}%
+ \else\ifx\EmFi at temp\EmFi at S@descending
+ \def\EmFi at temp{false}%
+ \else
+ \def\EmFi at temp{}%
+ \EmFi at Error{%
+ Unknown sort order `\EmFi at temp'.\MessageBreak
+ Supported values: `\EmFi at S@ascending', %
+ `\EmFi at S@descending
+ }\@ehc
+ \fi\fi
+ \ifx\EmFi at temp\ltx at empty
+ \else
+ \xdef\EmFi at sortkeys{%
+ \EmFi at sortkeys
+ /\pdf at escapename{#1}%
+ }%
+ \ifx\EmFi at sortorders\ltx at empty
+ \global\let\EmFi at sortorders\EmFi at temp
+ \gdef\EmFi at sortcase{1}%
+ \else
+ \xdef\EmFi at sortorders{%
+ \EmFi at sortorders
+ \ltx at space
+ \EmFi at temp
+ }%
+ \xdef\EmFi at sortcase{2}%
+ \fi
+ \fi
+ }%
+ \EmFi at GlobalDefaultKey{EmFiSo}\EmFi at key
+ \endgroup
+ \else
+ \EmFi at Error{%
+ Field `\EmFi at key' is already defined%
+ }\@ehc
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\kv at define@key{EmFiFi}{type}{%
+ \EdefSanitize\EmFi at temp{#1}%
+ \ifx\EmFi at temp\EmFi at S@text
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@date
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@number
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@file
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@desc
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@afrelationship
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@moddate
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@creationdate
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@size
+ \let\EmFi at type\EmFi at temp
+ \else
+ \EmFi at Error{%
+ Unknown type `\EmFi at temp'.\MessageBreak
+ Supported types: `text', `date', `number', `file',\MessageBreak
+ `desc', `afrelationship', `moddate', `creationdate', `size'%
+ }%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\kv at define@key{EmFiFi}{title}{%
+ \def\EmFi at title{#1}%
+}
+% \end{macrocode}
+% \begin{macro}{\EmFi at setboolean}
+% \begin{macrocode}
+\def\EmFi at setboolean#1#2{%
+ \EdefSanitize\EmFi at temp{#2}%
+ \ifx\EmFi at temp\EmFi at S@true
+ \csname EmFi@#1true\endcsname
+ \else
+ \ifx\EmFi at temp\EmFi at S@false
+ \csname EmFi@#1false\endcsname
+ \else
+ \EmFi at Error{%
+ Unknown value `\EmFi at temp' for key `#1'.\MessageBreak
+ Supported values: `true', `false'%
+ }\@ehc
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\kv at define@key{EmFiFi}{visible}[true]{%
+ \EmFi at setboolean{visible}{#1}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\kv at define@key{EmFiFi}{edit}[true]{%
+ \EmFi at setboolean{edit}{#1}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\EmFi at sortkeys}
+% \begin{macrocode}
+\def\EmFi at sortkeys{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at sortorders}
+% \begin{macrocode}
+\def\EmFi at sortorders{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfilesort}
+% \begin{macrocode}
+\def\embedfilesort{%
+ \kvsetkeys{EmFiSo}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Embed the file}
+%
+% \begin{macro}{\embedfile}
+% \begin{macrocode}
+\def\embedfile{%
+ \ltx at ifnextchar[\EmFi at embedfile{\EmFi at embedfile[]}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at embedfile}
+% \begin{macrocode}
+\def\EmFi at embedfile[#1]#2{%
+ \ifEmFi at finished
+ \EmFi at Error{%
+ \string\embedfile\ltx at space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \begingroup
+ \def\EmFi at file{#2}%
+ \kvsetkeys{EmFi}{#1}%
+ \expandafter\expandafter\expandafter
+ \ifx\expandafter\expandafter\expandafter
+ \\\pdf at filesize{\EmFi at file}\\%
+ \EmFi at Error{%
+ File `\EmFi at file' not found%
+ }{%
+ The unknown file is not embedded.%
+ }%
+ \else
+ \edef\EmFi@@filespec{%
+ \pdf at escapestring{\EmFi at filespec}%
+ }%
+ \ifx\EmFi at ucfilespec\ltx at empty
+ \let\EmFi@@ucfilespec\ltx at empty
+ \else
+ \EmFi at convert\EmFi at ucfilespec\EmFi@@ucfilespec
+ \fi
+ \ifx\EmFi at desc\ltx at empty
+ \let\EmFi@@desc\ltx at empty
+ \else
+ \EmFi at convert\EmFi at desc\EmFi@@desc
+ \fi
+ \ifx\EmFi at afrelationship\ltx at empty
+ \let\EmFi@@afrelationship\ltx at empty
+ \else
+ \EmFi at convert\EmFi at afrelationship\EmFi@@afrelationship
+ \fi
+ \ifEmFi at item
+ \let\do\EmFi at do
+ \immediate\pdfobj{%
+ <<%
+ \EmFi at fieldlist
+ >>%
+ }%
+ \edef\EmFi at ci{\the\pdflastobj}%
+ \fi
+ \immediate\pdfobj stream attr{%
+ /Type/EmbeddedFile%
+ \ifx\EmFi at mimetype\ltx at empty
+ \else
+ /Subtype/\pdf at escapename{\EmFi at mimetype}%
+ \fi
+ /Params<<%
+ /ModDate(\pdf at filemoddate{\EmFi at file})%
+ /Size \pdf at filesize{\EmFi at file}%
+ /CheckSum<\pdf at filemdfivesum{\EmFi at file}>%
+ >>%
+ }file{\EmFi at file}\relax
+ \EmFi at defobj{EmbeddedFile}%
+ \immediate\pdfobj{%
+ <<%
+ /Type/Filespec%
+ \ifx\EmFi at filesystem\ltx at empty
+ \else
+ /FS/\pdf at escapename{\EmFi at filesystem}%
+ \fi
+ /F(\EmFi@@filespec)%
+ \ifx\EmFi@@ucfilespec\ltx at empty
+ \else
+ /UF(\EmFi@@ucfilespec)%
+ \fi
+ \ifx\EmFi@@desc\ltx at empty
+ \else
+ /Desc(\EmFi@@desc)%
+ \fi
+ \ifx\EmFi@@afrelationship\ltx at empty
+ \else
+ /AFRelationship\EmFi@@afrelationship%
+ \fi
+ /EF<<%
+ /F \the\pdflastobj\ltx at space 0 R%
+ >>%
+ \ifEmFi at item
+ /CI \EmFi at ci\ltx at space 0 R%
+ \fi
+ >>%
+ }%
+ \EmFi at defobj{Filespec}%
+ \EmFi at add{%
+ \EmFi@@filespec
+ }{\the\pdflastobj\ltx at space 0 R}%
+ \fi
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at do}
+% \begin{macrocode}
+\def\EmFi at do#1{%
+ \expandafter\ifx\csname EmFi at P@#1\endcsname\relax
+ \expandafter\ifx\csname EmFi at V@#1\endcsname\relax
+ \else
+ /\pdf at escapename{#1}\csname EmFi at V@#1\endcsname
+ \fi
+ \else
+ /\pdf at escapename{#1}<<%
+ \expandafter\ifx\csname EmFi at V@#1\endcsname\relax
+ \else
+ /D\csname EmFi at V@#1\endcsname
+ \fi
+ /P(\csname EmFi at P@#1\endcsname)%
+ >>%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi at convert}
+% \begin{macrocode}
+\def\EmFi at convert#1#2{%
+ \ifnum\pdf at strcmp{\EmFi at stringmethod}{psd}=0 %
+ \pdfstringdef\EmFi at temp{#1}%
+ \let#2\EmFi at temp
+ \else
+ \edef#2{\pdf at escapestring{#1}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\global\let\EmFi at list\ltx at empty
+% \end{macrocode}
+% \begin{macro}{\EmFi at add}
+% Sorting is done by the insertion sort algorithm.
+% Probably the sorting could be done more reliable.
+% However, the PDF specification is not too clear to me
+% regarding precise sorting rules (how to deal with
+% different encodings, escaped characters, \dots).
+% \begin{macrocode}
+\def\EmFi at add#1#2{%
+ \begingroup
+ \ifx\EmFi at list\ltx at empty
+ \xdef\EmFi at list{\noexpand\do{#1}{#2}}%
+ \else
+ \def\do##1##2{%
+ \ifnum\pdf at strcmp{##1}{#1}>0 %
+ \edef\x{%
+ \toks@{%
+ \the\toks@%
+ \noexpand\do{#1}{#2}%
+ \noexpand\do{##1}{##2}%
+ }%
+ }%
+ \x
+ \def\do####1####2{%
+ \toks@\expandafter{\the\toks@\do{####1}{####2}}%
+ }%
+ \def\stop{%
+ \xdef\EmFi at list{\the\toks@}%
+ }%
+ \else
+ \toks@\expandafter{\the\toks@\do{##1}{##2}}%
+ \fi
+ }%
+ \def\stop{%
+ \xdef\EmFi at list{\the\toks@\noexpand\do{#1}{#2}}%
+ }%
+ \toks@{}%
+ \EmFi at list\stop
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfilefinish}
+% \begin{macrocode}
+\def\embedfilefinish{%
+ \ifEmFi at finished
+ \EmFi at Error{%
+ Too many invocations of \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \ifx\EmFi at list\ltx at empty
+ \else
+% \end{macrocode}
+% Write |/EmbeddedFiles| entry.
+% \begin{macrocode}
+ \global\EmFi at finishedtrue
+ \begingroup
+ \def\do##1##2{%
+ (##1)##2%
+ }%
+ \immediate\pdfobj{%
+ <<%
+ /Names[\EmFi at list]%
+ >>%
+ }%
+ \pdfnames{%
+ /EmbeddedFiles \the\pdflastobj\ltx at space 0 R%
+ }%
+ \endgroup
+ \begingroup
+ \def\do##1##2{%
+ \ltx at space##2%
+ }%
+ \immediate\pdfobj{%
+ [\EmFi at list]%
+ }%
+ \pdfcatalog{%
+ /AF \the\pdflastobj\ltx at space 0 R%
+ }%
+ \endgroup
+% \end{macrocode}
+% Write collection objects.
+% \begin{macrocode}
+ \ifx\EmFi at initialfile\ltx at empty
+ \else
+ \EmFi at collectiontrue
+ \fi
+ \ifEmFi at collection
+ \ifx\EmFi at initialfile\ltx at empty
+ \let\EmFi@@initialfile\ltx at empty
+ \else
+ \edef\EmFi@@initialfile{%
+ \pdf at escapestring{\EmFi at initialfile}%
+ }%
+ \fi
+% \end{macrocode}
+% Look for initial file among the embedded files.
+% \begin{macrocode}
+ \begingroup
+ \let\f=N%
+ \def\do##1##2{%
+ \def\x{##1}%
+ \ifx\x\EmFi@@initialfile
+ \let\f=Y%
+ \let\do\ltx at gobbletwo
+ \fi
+ }%
+ \EmFi at list
+ \expandafter\endgroup
+ \ifx\f Y%
+ \else
+ \@PackageWarningNoLine{embedfile}{%
+ Missing initial file `\EmFi at initialfile'\MessageBreak
+ among the embedded files%
+ }%
+ \let\EmFi at initialfile\ltx at empty
+ \let\EmFi@@initialfile\ltx at empty
+ \fi
+ \ifcase\EmFi at sortcase
+ \def\EmFi at temp{}%
+ \or
+ \def\EmFi at temp{%
+ /S\EmFi at sortkeys
+ /A \EmFi at sortorders
+ }%
+ \else
+ \def\EmFi at temp{%
+ /S[\EmFi at sortkeys]%
+ /A[\EmFi at sortorders]%
+ }%
+ \fi
+ \def\EmFi@@order##1{%
+ \ifnum\EmFi at order>1 %
+ /O ##1%
+ \fi
+ }%
+ \immediate\pdfobj{%
+ <<%
+ \ifx\EmFi at schema\ltx at empty
+ \else
+ /Schema<<\EmFi at schema>>%
+ \fi
+ \ifx\EmFi@@initialfile\ltx at empty
+ \else
+ /D(\EmFi@@initialfile)%
+ \fi
+ \ifx\EmFi at view\EmFi at S@tile
+ /View/T%
+ \else\ifx\EmFi at view\EmFi at S@hidden
+ /View/H%
+ \fi\fi
+ \ifx\EmFi at temp\ltx at empty
+ \EmFi at temp
+ \else
+ /Sort<<\EmFi at temp>>%
+ \fi
+ >>%
+ }%
+ \pdfcatalog{%
+ /Collection \the\pdflastobj\ltx at space0 R%
+ }%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname AtEndDocument\endcsname\relax
+\else
+ \AtEndDocument{\embedfilefinish}%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\EmFi at AtEnd%
+%</package>
+% \end{macrocode}
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\CTANpkg{embedfile}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/embedfile/embedfile.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/embedfile/embedfile.pdf}] Documentation.
+% \end{description}
+%
+%
+% \paragraph{Bundle.} All the packages of the bundle `embedfile'
+% are also available in a TDS compliant ZIP archive. There
+% the packages are already unpacked and the documentation files
+% are generated. The files and directories obey the TDS standard.
+% \begin{description}
+% \item[\CTANinstall{install/macros/latex/contrib/embedfile.tds.zip}]
+% \end{description}
+% \emph{TDS} refers to the standard ``A Directory Structure
+% for \TeX\ Files'' (\CTANpkg{tds}). Directories
+% with \xfile{texmf} in their name are usually organized this way.
+%
+% \subsection{Bundle installation}
+%
+% \paragraph{Unpacking.} Unpack the \xfile{embedfile.tds.zip} in the
+% TDS tree (also known as \xfile{texmf} tree) of your choice.
+% Example (linux):
+% \begin{quote}
+% |unzip embedfile.tds.zip -d ~/texmf|
+% \end{quote}
+%
+% \subsection{Package installation}
+%
+% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
+% \docstrip\ archive. The files are extracted by running the
+% \xfile{.dtx} through \plainTeX:
+% \begin{quote}
+% \verb|tex embedfile.dtx|
+% \end{quote}
+%
+% \paragraph{TDS.} Now the different files must be moved into
+% the different directories in your installation TDS tree
+% (also known as \xfile{texmf} tree):
+% \begin{quote}
+% \def\t{^^A
+% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
+% embedfile.sty & tex/generic/embedfile/embedfile.sty\\
+% dtx-attach.sty & tex/generic/embedfile/dtx-attach.sty\\
+% embedfile.pdf & doc/latex/embedfile/embedfile.pdf\\
+% embedfile-example-plain.tex & doc/latex/embedfile/embedfile-example-plain.tex\\
+% embedfile-example-collection.tex & doc/latex/embedfile/embedfile-example-collection.tex\\
+% embedfile.dtx & source/latex/embedfile/embedfile.dtx\\
+% \end{tabular}^^A
+% }^^A
+% \sbox0{\t}^^A
+% \ifdim\wd0>\linewidth
+% \begingroup
+% \advance\linewidth by\leftmargin
+% \advance\linewidth by\rightmargin
+% \edef\x{\endgroup
+% \def\noexpand\lw{\the\linewidth}^^A
+% }\x
+% \def\lwbox{^^A
+% \leavevmode
+% \hbox to \linewidth{^^A
+% \kern-\leftmargin\relax
+% \hss
+% \usebox0
+% \hss
+% \kern-\rightmargin\relax
+% }^^A
+% }^^A
+% \ifdim\wd0>\lw
+% \sbox0{\small\t}^^A
+% \ifdim\wd0>\linewidth
+% \ifdim\wd0>\lw
+% \sbox0{\footnotesize\t}^^A
+% \ifdim\wd0>\linewidth
+% \ifdim\wd0>\lw
+% \sbox0{\scriptsize\t}^^A
+% \ifdim\wd0>\linewidth
+% \ifdim\wd0>\lw
+% \sbox0{\tiny\t}^^A
+% \ifdim\wd0>\linewidth
+% \lwbox
+% \else
+% \usebox0
+% \fi
+% \else
+% \lwbox
+% \fi
+% \else
+% \usebox0
+% \fi
+% \else
+% \lwbox
+% \fi
+% \else
+% \usebox0
+% \fi
+% \else
+% \lwbox
+% \fi
+% \else
+% \usebox0
+% \fi
+% \else
+% \lwbox
+% \fi
+% \else
+% \usebox0
+% \fi
+% \end{quote}
+% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
+% TDS installing feature, then some files can already be in the right
+% place, see the documentation of \docstrip.
+%
+% \subsection{Refresh file name databases}
+%
+% If your \TeX~distribution
+% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
+% these. For example, \TeX\,Live\ users run \verb|texhash| or
+% \verb|mktexlsr|.
+%
+% \subsection{Some details for the interested}
+%
+% \paragraph{Unpacking with \LaTeX.}
+% The \xfile{.dtx} chooses its action depending on the format:
+% \begin{description}
+% \item[\plainTeX:] Run \docstrip\ and extract the files.
+% \item[\LaTeX:] Generate the documentation.
+% \end{description}
+% If you insist on using \LaTeX\ for \docstrip\ (really,
+% \docstrip\ does not need \LaTeX), then inform the autodetect routine
+% about your intention:
+% \begin{quote}
+% \verb|latex \let\install=y\input{embedfile.dtx}|
+% \end{quote}
+% Do not forget to quote the argument according to the demands
+% of your shell.
+%
+% \paragraph{Generating the documentation.}
+% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
+% the documentation. The process can be configured by the
+% configuration file \xfile{ltxdoc.cfg}. For instance, put this
+% line into this file, if you want to have A4 as paper format:
+% \begin{quote}
+% \verb|\PassOptionsToClass{a4paper}{article}|
+% \end{quote}
+% An example follows how to generate the
+% documentation with pdf\LaTeX:
+% \begin{quote}
+%\begin{verbatim}
+%pdflatex embedfile.dtx
+%makeindex -s gind.ist embedfile.idx
+%pdflatex embedfile.dtx
+%makeindex -s gind.ist embedfile.idx
+%pdflatex embedfile.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \begin{thebibliography}{9}
+% \bibitem{attachfile}
+% Scott Pakin: \textit{The \xpackage{attachfile} package};
+% 2005/02/20 v1.2;
+% \CTANpkg{attachfile}.
+%
+% \bibitem{attachfile2}
+% Heiko Oberdiek: \textit{The \xpackage{attachfile2} package};
+% 2006/08/16 v2.2;
+% \CTANpkg{attachfile2}.
+%
+% \bibitem{pdfspec}
+% Adobe Systems Incorporated:
+% \href{http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference.pdf}%
+% {\textit{PDF Reference, Sixth Edition, Version 1.7}},%
+% Oktober 2006;
+% \url{http://www.adobe.com/devnet/pdf/pdf_reference.html}.
+%
+% \bibitem{mime}
+% Network Working Group: RFC 2046, \textit{Multipurpose Internet Mail Extensions (MIME) Part Two:
+% Media Types}, November 1996; \url{http://www.rfc-editor.org/}.
+%
+% \bibitem{types}
+% IANA (Internet Assigned Numbers Authority):
+% \textit{MIME Media Types}, May 2006;
+% \url{http://www.iana.org/assignments/media-types/}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/08/16 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.1}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.2}
+% \item
+% Fixes for plain-TeX, wrapper for package \xpackage{keyval} added.
+% \item
+% Catcode section rewritten.
+% \end{Version}
+% \begin{Version}{2007/10/28 v2.0}
+% \item
+% Collection support added (PDF 1.7).
+% \end{Version}
+% \begin{Version}{2007/10/29 v2.1}
+% \item
+% Export of object references by adding new option \xoption{id} and
+% new macros \cs{embedfileifobjectexists} and \cs{embedfilegetobject}.
+% \end{Version}
+% \begin{Version}{2007/11/11 v2.2}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2007/11/25 v2.3}
+% \item
+% Fix in use of \cs{pdf at filesize}, bug introduced in previous version.
+% \end{Version}
+% \begin{Version}{2009/09/25 v2.4}
+% \item
+% Bug fix: If \xpackage{hyperref} is used with option \xoption{unicode},
+% the Unicode encoded file name causes trouble. Therefore \cs{pdfstringdef}
+% is now never used for option \xoption{filespec}, always method
+% \texttt{escape} is applied (Peter Cibulka).
+% \item
+% Bug fix for \xoption{initialfile}.
+% \item
+% Bug fix for file names in \texttt{/EmbeddedFiles}.
+% \item
+% New option \xoption{ucfilespec} for file name support in Unicode
+% (since PDF 1.7).
+% \end{Version}
+% \begin{Version}{2010/03/01 v2.5}
+% \item
+% Compatibility for \iniTeX.
+% \item
+% Package \xpackage{keyval} replaced by packages \xpackage{kvsetkeys}
+% and \xpackage{kvdefinekeys} because of compatibility for \iniTeX.
+% \item
+% TDS location moved from TDS:tex/latex/oberdiek/embedfile.sty to
+% TDS:tex/generic/oberdiek/embedfile.sty.
+% \end{Version}
+% \begin{Version}{2011/04/13 v2.6}
+% \item
+% Docu fixes (thanks Hans-Martin M\"unch).
+% \end{Version}
+% \begin{Version}{2016/05/15 v2.7}
+% \item
+% LuaTeX compatibility
+% \end{Version}
+% \begin{Version}{2018/11/01 v2.8}
+% \item
+% Remove luatex85 package depenency.
+% \end{Version}
+% \begin{Version}{2019/12/03 v2.9}
+% \item
+% add \verb|/AF| and \verb|/AFrelationship| keys (Andreas Karrenbauer)
+% \item
+% add \verb|\pdfcatalog| emulation for Lua\TeX.
+% \item
+% update to use \xpackage{iftex}
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
Property changes on: trunk/Master/texmf-dist/source/latex/embedfile/embedfile.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/generic/embedfile/embedfile.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/embedfile/embedfile.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/embedfile/embedfile.sty 2019-12-04 22:50:21 UTC (rev 53025)
@@ -0,0 +1,792 @@
+%%
+%% 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.
+%%
+%% Project: embedfile
+%% Version: 2019/12/03 v2.9
+%%
+%% Copyright (C)
+%% 2006-2011 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://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".
+%%
+%% The Current Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/embedfile/issues
+%%
+%%
+%% The Base Interpreter refers to any `TeX-Format',
+%% because some files are installed in TDS:tex/generic//.
+%%
+%% 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-example-collection.tex, embedfile-test1.tex,
+%% embedfile-test2.tex, embedfile-test3.tex,
+%% embedfile-test4.tex.
+%%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode35=6 % #
+ \catcode39=12 % '
+ \catcode44=12 % ,
+ \catcode45=12 % -
+ \catcode46=12 % .
+ \catcode58=12 % :
+ \catcode64=11 % @
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \expandafter\let\expandafter\x\csname ver at embedfile.sty\endcsname
+ \ifx\x\relax % plain-TeX, first loading
+ \else
+ \def\empty{}%
+ \ifx\x\empty % LaTeX, first loading,
+ % variable is initialized, but \ProvidesPackage not yet seen
+ \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}%
+ \aftergroup\endinput
+ \fi
+ \fi
+\endgroup%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode35=6 % #
+ \catcode39=12 % '
+ \catcode40=12 % (
+ \catcode41=12 % )
+ \catcode44=12 % ,
+ \catcode45=12 % -
+ \catcode46=12 % .
+ \catcode47=12 % /
+ \catcode58=12 % :
+ \catcode64=11 % @
+ \catcode91=12 % [
+ \catcode93=12 % ]
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \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\@undefined
+ \xdef#1{#3}%
+ \fi
+ \ifx#1\relax
+ \xdef#1{#3}%
+ \fi
+ }%
+ \fi
+\expandafter\x\csname ver at embedfile.sty\endcsname
+\ProvidesPackage{embedfile}%
+ [2019/12/03 v2.9 Embed files into PDF (HO)]%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \catcode64=11 % @
+ \def\x{\endgroup
+ \expandafter\edef\csname EmFi at AtEnd\endcsname{%
+ \endlinechar=\the\endlinechar\relax
+ \catcode13=\the\catcode13\relax
+ \catcode32=\the\catcode32\relax
+ \catcode35=\the\catcode35\relax
+ \catcode61=\the\catcode61\relax
+ \catcode64=\the\catcode64\relax
+ \catcode123=\the\catcode123\relax
+ \catcode125=\the\catcode125\relax
+ }%
+ }%
+\x\catcode61\catcode48\catcode32=10\relax%
+\catcode13=5 % ^^M
+\endlinechar=13 %
+\catcode35=6 % #
+\catcode64=11 % @
+\catcode123=1 % {
+\catcode125=2 % }
+\def\TMP at EnsureCode#1#2{%
+ \edef\EmFi at AtEnd{%
+ \EmFi at AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP at EnsureCode{39}{12}% '
+\TMP at EnsureCode{40}{12}% (
+\TMP at EnsureCode{41}{12}% )
+\TMP at EnsureCode{44}{12}% ,
+\TMP at EnsureCode{46}{12}% .
+\TMP at EnsureCode{47}{12}% /
+\TMP at EnsureCode{58}{12}% :
+\TMP at EnsureCode{60}{12}% <
+\TMP at EnsureCode{62}{12}% >
+\TMP at EnsureCode{91}{12}% [
+\TMP at EnsureCode{93}{12}% ]
+\TMP at EnsureCode{96}{12}% `
+\edef\EmFi at AtEnd{\EmFi at AtEnd\noexpand\endinput}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \def\EmFi at RequirePackage#1[#2]{%
+ \input #1.sty\relax
+ }%
+\else
+ \let\EmFi at RequirePackage\RequirePackage
+\fi
+\EmFi at RequirePackage{infwarerr}[2007/09/09]%
+\def\EmFi at Error{%
+ \@PackageError{embedfile}%
+}
+\ifx\pdfextension\@undefined\else
+ \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax}
+ \protected\def\pdfnames {\pdfextension names }
+ \protected\def\pdfobj {\pdfextension obj }
+ \protected\def\pdfcatalog {\pdfextension catalog }
+ \let\pdfoutput \outputmode
+\fi
+\EmFi at RequirePackage{iftex}[2019/11/07]
+\ifpdf
+\else
+ \EmFi at Error{%
+ Missing pdfTeX in PDF mode%
+ }{%
+ Currently other drivers are not supported. %
+ Package loading is aborted.%
+ }%
+ \expandafter\EmFi at AtEnd
+\fi%
+\EmFi at RequirePackage{pdftexcmds}[2007/11/11]
+\EmFi at RequirePackage{ltxcmds}[2010/03/01]
+\EmFi at RequirePackage{kvsetkeys}[2010/03/01]
+\EmFi at RequirePackage{kvdefinekeys}[2010/03/01]
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf at filesize\endcsname\relax
+ \EmFi at Error{%
+ Unsupported pdfTeX version%
+ }{%
+ At least version 1.30 is necessary. Package loading is aborted.%
+ }%
+ \expandafter\EmFi at AtEnd
+\fi%
+\EmFi at RequirePackage{pdfescape}[2007/11/11]
+\def\EmFi at temp#1{%
+ \expandafter\EdefSanitize\csname EmFi at S@#1\endcsname{#1}%
+}
+\EmFi at temp{details}%
+\EmFi at temp{tile}%
+\EmFi at temp{hidden}%
+\EmFi at temp{text}
+\EmFi at temp{date}
+\EmFi at temp{number}
+\EmFi at temp{file}
+\EmFi at temp{desc}
+\EmFi at temp{afrelationship}
+\EmFi at temp{moddate}
+\EmFi at temp{creationdate}
+\EmFi at temp{size}
+\EmFi at temp{ascending}
+\EmFi at temp{descending}
+\EmFi at temp{true}
+\EmFi at temp{false}
+\ltx at newif\ifEmFi at collection
+\ltx at newif\ifEmFi at sort
+\ltx at newif\ifEmFi at visible
+\ltx at newif\ifEmFi at edit
+\ltx at newif\ifEmFi at item
+\ltx at newif\ifEmFi at finished
+\ltx at newif\ifEmFi at id
+\def\EmFi at GlobalKey#1#2{%
+ \global\expandafter\let\csname KV@#1@#2\expandafter\endcsname
+ \csname KV@#1@#2\endcsname
+}
+\def\EmFi at GlobalDefaultKey#1#2{%
+ \EmFi at GlobalKey{#1}{#2}%
+ \global\expandafter\let
+ \csname KV@#1@#2 at default\expandafter\endcsname
+ \csname KV@#1@#2 at default\endcsname
+}
+\def\EmFi at DefineKey#1#2{%
+ \kv at define@key{EmFi}{#1}{%
+ \expandafter\def\csname EmFi@#1\endcsname{##1}%
+ }%
+ \expandafter\def\csname EmFi@#1\endcsname{#2}%
+}
+\EmFi at DefineKey{mimetype}{}
+\EmFi at DefineKey{filespec}{\EmFi at file}
+\EmFi at DefineKey{ucfilespec}{}
+\EmFi at DefineKey{filesystem}{}
+\EmFi at DefineKey{desc}{}
+\EmFi at DefineKey{afrelationship}{}
+\EmFi at DefineKey{stringmethod}{%
+ \ifx\pdfstringdef\@undefined
+ escape%
+ \else
+ \ifx\pdfstringdef\relax
+ escape%
+ \else
+ psd%
+ \fi
+ \fi
+}
+\kv at define@key{EmFi}{id}{%
+ \def\EmFi at id{#1}%
+ \EmFi at idtrue
+}
+\def\EmFi at defobj#1{%
+ \ifEmFi at id
+ \expandafter\xdef\csname EmFi@#1@\EmFi at id\endcsname{%
+ \the\pdflastobj\ltx at space 0 R%
+ }%
+ \fi
+}
+\def\embedfileifobjectexists#1#2{%
+ \expandafter\ifx\csname EmFi@#2@#1\endcsname\relax
+ \expandafter\ltx at secondoftwo
+ \else
+ \expandafter\ltx at firstoftwo
+ \fi
+}
+\def\embedfilegetobject#1#2{%
+ \embedfileifobjectexists{#1}{#2}{%
+ \csname EmFi@#2@#1\endcsname
+ }{%
+ 0 0 R%
+ }%
+}
+\kv at define@key{EmFi}{view}[]{%
+ \EdefSanitize\EmFi at temp{#1}%
+ \def\EmFi at next{%
+ \global\EmFi at collectiontrue
+ }%
+ \ifx\EmFi at temp\ltx at empty
+ \let\EmFi at view\EmFi at S@details
+ \else\ifx\EmFi at temp\EmFi at S@details
+ \let\EmFi at view\EmFi at S@details
+ \else\ifx\EmFi at temp\EmFi at S@tile
+ \let\EmFi at view\EmFi at S@tile
+ \else\ifx\EmFi at temp\EmFi at S@hidden
+ \let\EmFi at view\EmFi at S@hidden
+ \else
+ \let\EmFi at next\relax
+ \EmFi at Error{%
+ Unknown value `\EmFi at temp' for key `view'.\MessageBreak
+ Supported values: `details', `tile', `hidden'.%
+ }\@ehc
+ \fi\fi\fi\fi
+ \EmFi at next
+}
+\EmFi at DefineKey{initialfile}{}
+\def\embedfilesetup{%
+ \ifEmFi at finished
+ \def\EmFi at next##1{}%
+ \EmFi at Error{%
+ \string\embedfilefield\ltx at space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \def\EmFi at next{%
+ \kvsetkeys{EmFi}%
+ }%
+ \fi
+ \EmFi at next
+}
+\def\EmFi at schema{}
+\gdef\EmFi at order{0}
+\let\EmFi@@order\relax
+\def\EmFi at fieldlist{}
+\def\EmFi at sortcase{0}%
+\def\embedfilefield#1#2{%
+ \ifEmFi at finished
+ \EmFi at Error{%
+ \string\embedfilefield\ltx at space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \global\EmFi at collectiontrue
+ \EdefSanitize\EmFi at key{#1}%
+ \expandafter\ifx\csname KV at EmFi@\EmFi at key.prefix\endcsname\relax
+ \begingroup
+ \count@=\EmFi at order
+ \advance\count@ 1 %
+ \xdef\EmFi at order{\the\count@}%
+ \let\EmFi at title\EmFi at key
+ \let\EmFi at type\EmFi at S@text
+ \EmFi at visibletrue
+ \EmFi at editfalse
+ \kvsetkeys{EmFiFi}{#2}%
+ \EmFi at convert\EmFi at title\EmFi at title
+ \xdef\EmFi at schema{%
+ \EmFi at schema
+ /\pdf at escapename{\EmFi at key}<<%
+ /Subtype/%
+ \ifx\EmFi at type\EmFi at S@date D%
+ \else\ifx\EmFi at type\EmFi at S@number N%
+ \else\ifx\EmFi at type\EmFi at S@file F%
+ \else\ifx\EmFi at type\EmFi at S@desc Desc%
+ \else\ifx\EmFi at type\EmFi at S@afrelationship AFRelationship%
+ \else\ifx\EmFi at type\EmFi at S@moddate ModDate%
+ \else\ifx\EmFi at type\EmFi at S@creationdate CreationDate%
+ \else\ifx\EmFi at type\EmFi at S@size Size%
+ \else S%
+ \fi\fi\fi\fi\fi\fi\fi
+ /N(\EmFi at title)%
+ \EmFi@@order{\EmFi at order}%
+ \ifEmFi at visible
+ \else
+ /V false%
+ \fi
+ \ifEmFi at edit
+ /E true%
+ \fi
+ >>%
+ }%
+ \let\do\relax
+ \xdef\EmFi at fieldlist{%
+ \EmFi at fieldlist
+ \do{\EmFi at key}%
+ }%
+ \ifx\EmFi at type\EmFi at S@text
+ \kv at define@key{EmFi}{\EmFi at key.value}{%
+ \EmFi at itemtrue
+ \def\EmFi at temp{##1}%
+ \EmFi at convert\EmFi at temp\EmFi at temp
+ \expandafter\def\csname EmFi at V@#1%
+ \expandafter\endcsname\expandafter{%
+ \expandafter(\EmFi at temp)%
+ }%
+ }%
+ \EmFi at GlobalKey{EmFi}{\EmFi at key.value}%
+ \else\ifx\EmFi at type\EmFi at S@date
+ \kv at define@key{EmFi}{\EmFi at key.value}{%
+ \EmFi at itemtrue
+ \def\EmFi at temp{##1}%
+ \EmFi at convert\EmFi at temp\EmFi at temp
+ \expandafter\def\csname EmFi at V@#1%
+ \expandafter\endcsname\expandafter{%
+ \expandafter(\EmFi at temp)%
+ }%
+ }%
+ \EmFi at GlobalKey{EmFi}{\EmFi at key.value}%
+ \else\ifx\EmFi at type\EmFi at S@number
+ \kv at define@key{EmFi}{\EmFi at key.value}{%
+ \EmFi at itemtrue
+ \expandafter\EdefSanitize\csname EmFi at V@#1\endcsname{ ##1}%
+ }%
+ \EmFi at GlobalKey{EmFi}{\EmFi at key.value}%
+ \fi\fi\fi
+ \kv at define@key{EmFi}{\EmFi at key.prefix}{%
+ \EmFi at itemtrue
+ \expandafter\def\csname EmFi at P@#1\endcsname{##1}%
+ }%
+ \EmFi at GlobalKey{EmFi}{\EmFi at key.prefix}%
+ \kv at define@key{EmFiSo}{\EmFi at key}[ascending]{%
+ \EdefSanitize\EmFi at temp{##1}%
+ \ifx\EmFi at temp\EmFi at S@ascending
+ \def\EmFi at temp{true}%
+ \else\ifx\EmFi at temp\EmFi at S@descending
+ \def\EmFi at temp{false}%
+ \else
+ \def\EmFi at temp{}%
+ \EmFi at Error{%
+ Unknown sort order `\EmFi at temp'.\MessageBreak
+ Supported values: `\EmFi at S@ascending', %
+ `\EmFi at S@descending
+ }\@ehc
+ \fi\fi
+ \ifx\EmFi at temp\ltx at empty
+ \else
+ \xdef\EmFi at sortkeys{%
+ \EmFi at sortkeys
+ /\pdf at escapename{#1}%
+ }%
+ \ifx\EmFi at sortorders\ltx at empty
+ \global\let\EmFi at sortorders\EmFi at temp
+ \gdef\EmFi at sortcase{1}%
+ \else
+ \xdef\EmFi at sortorders{%
+ \EmFi at sortorders
+ \ltx at space
+ \EmFi at temp
+ }%
+ \xdef\EmFi at sortcase{2}%
+ \fi
+ \fi
+ }%
+ \EmFi at GlobalDefaultKey{EmFiSo}\EmFi at key
+ \endgroup
+ \else
+ \EmFi at Error{%
+ Field `\EmFi at key' is already defined%
+ }\@ehc
+ \fi
+ \fi
+}
+\kv at define@key{EmFiFi}{type}{%
+ \EdefSanitize\EmFi at temp{#1}%
+ \ifx\EmFi at temp\EmFi at S@text
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@date
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@number
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@file
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@desc
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@afrelationship
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@moddate
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@creationdate
+ \let\EmFi at type\EmFi at temp
+ \else\ifx\EmFi at temp\EmFi at S@size
+ \let\EmFi at type\EmFi at temp
+ \else
+ \EmFi at Error{%
+ Unknown type `\EmFi at temp'.\MessageBreak
+ Supported types: `text', `date', `number', `file',\MessageBreak
+ `desc', `afrelationship', `moddate', `creationdate', `size'%
+ }%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+\kv at define@key{EmFiFi}{title}{%
+ \def\EmFi at title{#1}%
+}
+\def\EmFi at setboolean#1#2{%
+ \EdefSanitize\EmFi at temp{#2}%
+ \ifx\EmFi at temp\EmFi at S@true
+ \csname EmFi@#1true\endcsname
+ \else
+ \ifx\EmFi at temp\EmFi at S@false
+ \csname EmFi@#1false\endcsname
+ \else
+ \EmFi at Error{%
+ Unknown value `\EmFi at temp' for key `#1'.\MessageBreak
+ Supported values: `true', `false'%
+ }\@ehc
+ \fi
+ \fi
+}
+\kv at define@key{EmFiFi}{visible}[true]{%
+ \EmFi at setboolean{visible}{#1}%
+}
+\kv at define@key{EmFiFi}{edit}[true]{%
+ \EmFi at setboolean{edit}{#1}%
+}
+\def\EmFi at sortkeys{}
+\def\EmFi at sortorders{}
+\def\embedfilesort{%
+ \kvsetkeys{EmFiSo}%
+}
+\def\embedfile{%
+ \ltx at ifnextchar[\EmFi at embedfile{\EmFi at embedfile[]}%
+}
+\def\EmFi at embedfile[#1]#2{%
+ \ifEmFi at finished
+ \EmFi at Error{%
+ \string\embedfile\ltx at space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \begingroup
+ \def\EmFi at file{#2}%
+ \kvsetkeys{EmFi}{#1}%
+ \expandafter\expandafter\expandafter
+ \ifx\expandafter\expandafter\expandafter
+ \\\pdf at filesize{\EmFi at file}\\%
+ \EmFi at Error{%
+ File `\EmFi at file' not found%
+ }{%
+ The unknown file is not embedded.%
+ }%
+ \else
+ \edef\EmFi@@filespec{%
+ \pdf at escapestring{\EmFi at filespec}%
+ }%
+ \ifx\EmFi at ucfilespec\ltx at empty
+ \let\EmFi@@ucfilespec\ltx at empty
+ \else
+ \EmFi at convert\EmFi at ucfilespec\EmFi@@ucfilespec
+ \fi
+ \ifx\EmFi at desc\ltx at empty
+ \let\EmFi@@desc\ltx at empty
+ \else
+ \EmFi at convert\EmFi at desc\EmFi@@desc
+ \fi
+ \ifx\EmFi at afrelationship\ltx at empty
+ \let\EmFi@@afrelationship\ltx at empty
+ \else
+ \EmFi at convert\EmFi at afrelationship\EmFi@@afrelationship
+ \fi
+ \ifEmFi at item
+ \let\do\EmFi at do
+ \immediate\pdfobj{%
+ <<%
+ \EmFi at fieldlist
+ >>%
+ }%
+ \edef\EmFi at ci{\the\pdflastobj}%
+ \fi
+ \immediate\pdfobj stream attr{%
+ /Type/EmbeddedFile%
+ \ifx\EmFi at mimetype\ltx at empty
+ \else
+ /Subtype/\pdf at escapename{\EmFi at mimetype}%
+ \fi
+ /Params<<%
+ /ModDate(\pdf at filemoddate{\EmFi at file})%
+ /Size \pdf at filesize{\EmFi at file}%
+ /CheckSum<\pdf at filemdfivesum{\EmFi at file}>%
+ >>%
+ }file{\EmFi at file}\relax
+ \EmFi at defobj{EmbeddedFile}%
+ \immediate\pdfobj{%
+ <<%
+ /Type/Filespec%
+ \ifx\EmFi at filesystem\ltx at empty
+ \else
+ /FS/\pdf at escapename{\EmFi at filesystem}%
+ \fi
+ /F(\EmFi@@filespec)%
+ \ifx\EmFi@@ucfilespec\ltx at empty
+ \else
+ /UF(\EmFi@@ucfilespec)%
+ \fi
+ \ifx\EmFi@@desc\ltx at empty
+ \else
+ /Desc(\EmFi@@desc)%
+ \fi
+ \ifx\EmFi@@afrelationship\ltx at empty
+ \else
+ /AFRelationship\EmFi@@afrelationship%
+ \fi
+ /EF<<%
+ /F \the\pdflastobj\ltx at space 0 R%
+ >>%
+ \ifEmFi at item
+ /CI \EmFi at ci\ltx at space 0 R%
+ \fi
+ >>%
+ }%
+ \EmFi at defobj{Filespec}%
+ \EmFi at add{%
+ \EmFi@@filespec
+ }{\the\pdflastobj\ltx at space 0 R}%
+ \fi
+ \endgroup
+ \fi
+}
+\def\EmFi at do#1{%
+ \expandafter\ifx\csname EmFi at P@#1\endcsname\relax
+ \expandafter\ifx\csname EmFi at V@#1\endcsname\relax
+ \else
+ /\pdf at escapename{#1}\csname EmFi at V@#1\endcsname
+ \fi
+ \else
+ /\pdf at escapename{#1}<<%
+ \expandafter\ifx\csname EmFi at V@#1\endcsname\relax
+ \else
+ /D\csname EmFi at V@#1\endcsname
+ \fi
+ /P(\csname EmFi at P@#1\endcsname)%
+ >>%
+ \fi
+}
+\def\EmFi at convert#1#2{%
+ \ifnum\pdf at strcmp{\EmFi at stringmethod}{psd}=0 %
+ \pdfstringdef\EmFi at temp{#1}%
+ \let#2\EmFi at temp
+ \else
+ \edef#2{\pdf at escapestring{#1}}%
+ \fi
+}
+\global\let\EmFi at list\ltx at empty
+\def\EmFi at add#1#2{%
+ \begingroup
+ \ifx\EmFi at list\ltx at empty
+ \xdef\EmFi at list{\noexpand\do{#1}{#2}}%
+ \else
+ \def\do##1##2{%
+ \ifnum\pdf at strcmp{##1}{#1}>0 %
+ \edef\x{%
+ \toks@{%
+ \the\toks@%
+ \noexpand\do{#1}{#2}%
+ \noexpand\do{##1}{##2}%
+ }%
+ }%
+ \x
+ \def\do####1####2{%
+ \toks@\expandafter{\the\toks@\do{####1}{####2}}%
+ }%
+ \def\stop{%
+ \xdef\EmFi at list{\the\toks@}%
+ }%
+ \else
+ \toks@\expandafter{\the\toks@\do{##1}{##2}}%
+ \fi
+ }%
+ \def\stop{%
+ \xdef\EmFi at list{\the\toks@\noexpand\do{#1}{#2}}%
+ }%
+ \toks@{}%
+ \EmFi at list\stop
+ \fi
+ \endgroup
+}
+\def\embedfilefinish{%
+ \ifEmFi at finished
+ \EmFi at Error{%
+ Too many invocations of \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \ifx\EmFi at list\ltx at empty
+ \else
+ \global\EmFi at finishedtrue
+ \begingroup
+ \def\do##1##2{%
+ (##1)##2%
+ }%
+ \immediate\pdfobj{%
+ <<%
+ /Names[\EmFi at list]%
+ >>%
+ }%
+ \pdfnames{%
+ /EmbeddedFiles \the\pdflastobj\ltx at space 0 R%
+ }%
+ \endgroup
+ \begingroup
+ \def\do##1##2{%
+ \ltx at space##2%
+ }%
+ \immediate\pdfobj{%
+ [\EmFi at list]%
+ }%
+ \pdfcatalog{%
+ /AF \the\pdflastobj\ltx at space 0 R%
+ }%
+ \endgroup
+ \ifx\EmFi at initialfile\ltx at empty
+ \else
+ \EmFi at collectiontrue
+ \fi
+ \ifEmFi at collection
+ \ifx\EmFi at initialfile\ltx at empty
+ \let\EmFi@@initialfile\ltx at empty
+ \else
+ \edef\EmFi@@initialfile{%
+ \pdf at escapestring{\EmFi at initialfile}%
+ }%
+ \fi
+ \begingroup
+ \let\f=N%
+ \def\do##1##2{%
+ \def\x{##1}%
+ \ifx\x\EmFi@@initialfile
+ \let\f=Y%
+ \let\do\ltx at gobbletwo
+ \fi
+ }%
+ \EmFi at list
+ \expandafter\endgroup
+ \ifx\f Y%
+ \else
+ \@PackageWarningNoLine{embedfile}{%
+ Missing initial file `\EmFi at initialfile'\MessageBreak
+ among the embedded files%
+ }%
+ \let\EmFi at initialfile\ltx at empty
+ \let\EmFi@@initialfile\ltx at empty
+ \fi
+ \ifcase\EmFi at sortcase
+ \def\EmFi at temp{}%
+ \or
+ \def\EmFi at temp{%
+ /S\EmFi at sortkeys
+ /A \EmFi at sortorders
+ }%
+ \else
+ \def\EmFi at temp{%
+ /S[\EmFi at sortkeys]%
+ /A[\EmFi at sortorders]%
+ }%
+ \fi
+ \def\EmFi@@order##1{%
+ \ifnum\EmFi at order>1 %
+ /O ##1%
+ \fi
+ }%
+ \immediate\pdfobj{%
+ <<%
+ \ifx\EmFi at schema\ltx at empty
+ \else
+ /Schema<<\EmFi at schema>>%
+ \fi
+ \ifx\EmFi@@initialfile\ltx at empty
+ \else
+ /D(\EmFi@@initialfile)%
+ \fi
+ \ifx\EmFi at view\EmFi at S@tile
+ /View/T%
+ \else\ifx\EmFi at view\EmFi at S@hidden
+ /View/H%
+ \fi\fi
+ \ifx\EmFi at temp\ltx at empty
+ \EmFi at temp
+ \else
+ /Sort<<\EmFi at temp>>%
+ \fi
+ >>%
+ }%
+ \pdfcatalog{%
+ /Collection \the\pdflastobj\ltx at space0 R%
+ }%
+ \fi
+ \fi
+ \fi
+}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname AtEndDocument\endcsname\relax
+\else
+ \AtEndDocument{\embedfilefinish}%
+\fi
+\EmFi at AtEnd%
+\endinput
+%%
+%% End of file `embedfile.sty'.
Property changes on: trunk/Master/texmf-dist/tex/generic/embedfile/embedfile.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/embedfile/dtx-attach.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/embedfile/dtx-attach.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/embedfile/dtx-attach.sty 2019-12-04 22:50:21 UTC (rev 53025)
@@ -0,0 +1,57 @@
+%%
+%% This is file `dtx-attach.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% embedfile.dtx (with options: `dtxattach')
+%%
+%% This is a generated file.
+%%
+%% Project: embedfile
+%% Version: 2019/12/03 v2.9
+%%
+%% Copyright (C)
+%% 2006-2011 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://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".
+%%
+%% The Current Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/embedfile/issues
+%%
+%%
+%% The Base Interpreter refers to any `TeX-Format',
+%% because some files are installed in TDS:tex/generic//.
+%%
+%% 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-example-collection.tex, embedfile-test1.tex,
+%% embedfile-test2.tex, embedfile-test3.tex,
+%% embedfile-test4.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{dtx-attach}
+ [2019/12/03 v2.9 Embed \string\jobname.dtx (HO)]%
+\RequirePackage{embedfile}[2019/12/03]
+\embedfile[%
+ stringmethod=escape,%
+ mimetype=plain/text,%
+ desc={LaTeX docstrip source archive for package `\jobname'}%
+]{\jobname.dtx}
+\endinput
+%%
+%% End of file `dtx-attach.sty'.
Property changes on: trunk/Master/texmf-dist/tex/latex/embedfile/dtx-attach.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2019-12-04 22:49:34 UTC (rev 53024)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2019-12-04 22:50:21 UTC (rev 53025)
@@ -255,7 +255,7 @@
ellipse ellipsis
elmath elocalloc elpres els-cas-templates elsarticle
elteikthesis eltex elvish elzcards
- emarks embedall embrac emf emisa emptypage emulateapj emp
+ emarks embedall embedfile embrac emf emisa emptypage emulateapj emp
enctex encxvlna endfloat endheads endiagram endnotes endnotesj endofproofwd
engpron engrec engtlc enigma enotez
enumitem enumitem-zref envbig environ envlab
Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc 2019-12-04 22:49:34 UTC (rev 53024)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc 2019-12-04 22:50:21 UTC (rev 53025)
@@ -358,6 +358,7 @@
depend elzcards
depend emarks
depend embedall
+depend embedfile
depend embrac
depend emptypage
depend emulateapj
Added: trunk/Master/tlpkg/tlpsrc/embedfile.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list